├── latex ├── html_entity ├── __init__.py ├── README.rst └── html_entity.py ├── libravatar ├── .gitignore ├── __init__.py └── test_data │ └── theme │ └── templates │ └── article.html ├── pdf ├── __init__.py ├── Readme.rst └── test_pdf.py ├── yuicompressor ├── .gitignore ├── __init__.py ├── README.md └── yuicompressor.py ├── ical ├── __init__.py └── Readme.rst ├── read_more_link ├── requirements.txt ├── __init__.py └── Readme.md ├── sitemap └── __init__.py ├── slim ├── __init__.py └── README.md ├── test_data ├── themes │ ├── simple │ │ └── templates │ │ │ ├── tag.html │ │ │ ├── tags.html │ │ │ ├── category.html │ │ │ ├── author.html │ │ │ ├── categories.html │ │ │ ├── translations.html │ │ │ ├── page.html │ │ │ ├── archives.html │ │ │ ├── gosquared.html │ │ │ ├── pagination.html │ │ │ ├── article.html │ │ │ └── index.html │ └── notmyidea │ │ ├── templates │ │ ├── authors.html │ │ ├── tag.html │ │ ├── author.html │ │ ├── category.html │ │ ├── comments.html │ │ ├── taglist.html │ │ ├── twitter.html │ │ ├── translations.html │ │ ├── archives.html │ │ ├── github.html │ │ ├── disqus_script.html │ │ ├── page.html │ │ ├── analytics.html │ │ ├── article_infos.html │ │ ├── piwik.html │ │ └── article.html │ │ └── static │ │ ├── images │ │ └── icons │ │ │ ├── rss.png │ │ │ ├── vimeo.png │ │ │ ├── aboutme.png │ │ │ ├── github.png │ │ │ ├── gittip.png │ │ │ ├── lastfm.png │ │ │ ├── reddit.png │ │ │ ├── twitter.png │ │ │ ├── youtube.png │ │ │ ├── bitbucket.png │ │ │ ├── delicious.png │ │ │ ├── facebook.png │ │ │ ├── gitorious.png │ │ │ ├── hackernews.png │ │ │ ├── linkedin.png │ │ │ ├── slideshare.png │ │ │ ├── google-plus.png │ │ │ ├── speakerdeck.png │ │ │ └── google-groups.png │ │ └── css │ │ ├── typogrify.css │ │ ├── wide.css │ │ └── reset.css ├── content │ ├── unwanted_file │ ├── extra │ │ └── robots.txt │ ├── cat1 │ │ ├── article2.rst │ │ ├── article3.rst │ │ ├── article1.rst │ │ └── markdown-article.md │ ├── pictures │ │ ├── Sushi.jpg │ │ ├── Fat_Cat.jpg │ │ └── Sushi_Macro.jpg │ ├── 2012-11-30_filename-metadata.rst │ ├── pages │ │ ├── jinja2_template.html │ │ ├── test_page.rst │ │ ├── hidden_page.rst │ │ └── override_url_saveas.rst │ ├── another_super_article-fr.rst │ ├── article2.rst │ ├── draft_article.rst │ ├── article2-fr.rst │ ├── unbelievable.rst │ ├── another_super_article.rst │ └── super_article.rst ├── Readme.rst └── pelican.conf.py ├── assets ├── __init__.py └── test_data │ ├── static │ └── css │ │ ├── style.min.css │ │ └── style.scss │ └── templates │ └── base.html ├── dateish ├── __init__.py ├── dateish.py └── Readme.rst ├── events ├── __init__.py └── events_list.html ├── gallery └── __init__.py ├── github-wiki ├── __init__.py └── wiki.js ├── glossary └── __init__.py ├── gravatar ├── __init__.py ├── Readme.rst └── gravatar.py ├── headerid ├── __init__.py ├── README.rst └── headerid.py ├── i18n_subsites ├── test_data │ ├── content │ │ ├── images │ │ │ └── img.png │ │ ├── pages │ │ │ ├── untranslated-page.rst │ │ │ ├── hidden-page-en.rst │ │ │ ├── hidden-page-cz.rst │ │ │ └── hidden-page-de.rst │ │ ├── translated_article-cz.rst │ │ ├── translated_article-en.rst │ │ ├── translated_article-de.rst │ │ └── untranslated_article-en.rst │ ├── output │ │ ├── images │ │ │ └── img.png │ │ ├── theme │ │ │ └── style.css │ │ ├── de │ │ │ └── pages │ │ │ │ ├── untranslated-page-en.html │ │ │ │ └── 404.html │ │ ├── pages │ │ │ ├── untranslated-page.html │ │ │ └── 404.html │ │ └── cz │ │ │ └── pages │ │ │ └── 404.html │ ├── localized_theme │ │ ├── static │ │ │ └── style.css │ │ ├── babel.cfg │ │ ├── translations │ │ │ └── de │ │ │ │ └── LC_MESSAGES │ │ │ │ ├── messages.mo │ │ │ │ └── messages.po │ │ ├── templates │ │ │ └── base.html │ │ └── messages.pot │ └── pelicanconf.py └── __init__.py ├── linker ├── __init__.py ├── content_objects.py ├── mailto.py └── Readme.md ├── pelican_comment_system ├── identicon │ ├── __init__.py │ ├── README.md │ └── LICENSE ├── __init__.py ├── doc │ ├── feed.md │ ├── avatars.md │ └── quickstart.md └── Readme.md ├── photos ├── __init__.py ├── requirements.txt ├── test_data │ ├── agallery │ │ ├── captions.txt │ │ ├── exif.txt │ │ ├── best.jpg │ │ └── night.png │ ├── photo.md │ └── filename.md ├── SourceCodePro-Bold.otf └── SourceCodePro-Regular.otf ├── render_math └── __init__.py ├── series └── __init__.py ├── summary └── __init__.py ├── autopages ├── __init__.py ├── LICENSE └── README.md ├── gzip_cache ├── __init__.py └── Readme.rst ├── interlinks ├── __init__.py └── test_data │ └── testme.md ├── members ├── __init__.py ├── Readme.rst └── members.py ├── multi_part ├── __init__.py ├── Readme.md └── multi_part.py ├── neighbors └── __init__.py ├── org_reader ├── __init__.py └── LICENSE ├── plantuml └── __init__.py ├── post_stats ├── __init__.py ├── readability.py └── readme.rst ├── rmd_reader └── __init__.py ├── share_post └── __init__.py ├── sub_parts ├── __init__.py └── test_data │ ├── noparent.md │ ├── parent.md │ ├── parent--implicit.md │ └── parent-explicit.md ├── thumbnailer ├── __init__.py └── test_data │ ├── sample_image.jpg │ ├── expected_exact.jpg │ ├── expected_height.jpg │ ├── expected_square.jpg │ ├── expected_width.jpg │ └── subdir │ └── sample_image.jpg ├── author_images ├── __init__.py ├── generate_hashsum.py └── author_images.py ├── category_meta ├── __init__.py └── README.md ├── clean_summary ├── __init__.py └── README.md ├── code_include └── __init__.py ├── creole_reader ├── __init__.py └── Readme.md ├── disqus_static └── __init__.py ├── extract_toc └── __init__.py ├── feed_summary └── __init__.py ├── footer_insert ├── __init__.py ├── README.md └── footer_insert.py ├── jinja2content └── __init__.py ├── liquid_tags ├── __init__.py ├── test_data │ ├── pelicanhtml_2.tpl │ ├── pelicanhtml_3.tpl │ ├── content │ │ ├── test-ipython-notebook-nbformat3.md │ │ └── test-ipython-notebook-nbformat4.md │ ├── pelicanconf.py │ └── flickr.json ├── .gitignore ├── tox.ini ├── literal.py ├── liquid_tags.py ├── test_soundcloud.py ├── speakerdeck.py ├── test_giphy.py ├── spotify.py ├── pelicanhtml_2.tpl ├── pelicanhtml_1.tpl ├── test_audio.py ├── pelicanhtml_3.tpl └── soundcloud.py ├── md_inline_extension └── __init__.py ├── pelican-rdf ├── __init__.py └── sparql-queries │ ├── lov_metadata.sparql │ └── classes.sparql ├── related_posts ├── __init__.py └── Readme.rst ├── section_number ├── __init__.py └── Readme.md ├── show_source └── __init__.py ├── subcategory └── __init__.py ├── tag_cloud ├── __init__.py └── test_data │ ├── article_1.md │ ├── article_4.md │ ├── article_3.md │ ├── article_2.md │ └── article_5.md ├── tipue_search └── __init__.py ├── always_modified ├── __init__.py ├── README.md └── always_modified.py ├── asciidoc_reader ├── __init__.py └── test_data │ ├── article_with_asc_options.asc │ └── article_with_asc_extension.asc ├── collate_content ├── .gitignore └── __init__.py ├── filetime_from_git ├── __init__.py ├── utils.py └── registration.py ├── gist_directive ├── __init__.py └── README.rst ├── github_activity ├── __init__.py └── Readme.rst ├── global_license ├── __init__.py ├── Readme.rst └── global_license.py ├── goodreads_activity └── __init__.py ├── optimize_images ├── __init__.py └── Readme.md ├── permalinks ├── __init__.py └── README.md ├── random_article ├── __init__.py └── Readme.md ├── static_comments ├── __init__.py ├── Readme.md └── static_comments.py ├── textile_reader ├── __init__.py └── Readme.textile ├── txt2tags_reader ├── __init__.py ├── README.md ├── LICENSE └── txt2tags_reader.py ├── filetime_from_hg ├── __init__.py └── README.rst ├── html_rst_directive ├── __init__.py ├── html_rst_directive.py └── Readme.rst ├── simple_footnotes ├── __init__.py ├── README.md └── test_simple_footnotes.py ├── custom_article_urls ├── __init__.py └── README.md ├── googleplus_comments ├── __init__.py ├── Readme.md └── googleplus_comments.py ├── representative_image ├── __init__.py └── Readme.md ├── video_privacy_enhancer ├── __init__.py └── video_service_thumbnail_url_generating_functions.py ├── better_figures_and_images ├── __init__.py └── test_data │ ├── dummy-200x200.png │ ├── dummy-250x300.png │ └── dummy-800x300.png ├── w3c_validate ├── __init__.py └── README.md ├── better_codeblock_line_numbering └── __init__.py ├── bootstrap-rst ├── 140x140.png ├── 171x180.png ├── 300x200.png ├── bootstrap │ └── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff ├── __init__.py ├── doc │ ├── components-badges.txt │ ├── bootstrap-roles.txt │ ├── components-page-header.txt │ ├── components-breadcrumbs.txt │ ├── components-wells.txt │ ├── components-jumbotron.txt │ ├── CSS-code.txt │ ├── CSS-images.txt │ ├── components-glyphicons.txt │ └── components-labels.txt ├── page.tmpl ├── Makefile ├── LICENSE ├── README.rst ├── custom.css └── roles.py ├── pelican_unity_webgl ├── __init__.py ├── config.py ├── template.txt └── LICENSE.txt ├── twitter_bootstrap_rst_directives ├── __init__.py └── Readme.rst ├── .gitignore ├── touch ├── README.rst └── __init__.py ├── .travis.yml ├── better_tables ├── LICENSE ├── README.md └── __init__.py └── Contributing.rst /latex: -------------------------------------------------------------------------------- 1 | render_math/ -------------------------------------------------------------------------------- /html_entity/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libravatar/.gitignore: -------------------------------------------------------------------------------- 1 | /*.pyc 2 | -------------------------------------------------------------------------------- /pdf/__init__.py: -------------------------------------------------------------------------------- 1 | from .pdf import * 2 | -------------------------------------------------------------------------------- /yuicompressor/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /ical/__init__.py: -------------------------------------------------------------------------------- 1 | from .ical import * 2 | -------------------------------------------------------------------------------- /read_more_link/requirements.txt: -------------------------------------------------------------------------------- 1 | lxml>=3.2.1 -------------------------------------------------------------------------------- /sitemap/__init__.py: -------------------------------------------------------------------------------- 1 | from .sitemap import * -------------------------------------------------------------------------------- /slim/__init__.py: -------------------------------------------------------------------------------- 1 | from .slim import * 2 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/tag.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/tags.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/__init__.py: -------------------------------------------------------------------------------- 1 | from .assets import * 2 | -------------------------------------------------------------------------------- /dateish/__init__.py: -------------------------------------------------------------------------------- 1 | from .dateish import * 2 | -------------------------------------------------------------------------------- /events/__init__.py: -------------------------------------------------------------------------------- 1 | from .events import * 2 | -------------------------------------------------------------------------------- /gallery/__init__.py: -------------------------------------------------------------------------------- 1 | from .gallery import * 2 | -------------------------------------------------------------------------------- /github-wiki/__init__.py: -------------------------------------------------------------------------------- 1 | from .wiki import * 2 | -------------------------------------------------------------------------------- /glossary/__init__.py: -------------------------------------------------------------------------------- 1 | from .glossary import * 2 | -------------------------------------------------------------------------------- /gravatar/__init__.py: -------------------------------------------------------------------------------- 1 | from .gravatar import * 2 | -------------------------------------------------------------------------------- /headerid/__init__.py: -------------------------------------------------------------------------------- 1 | from .headerid import * 2 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/images/img.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/images/img.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/theme/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linker/__init__.py: -------------------------------------------------------------------------------- 1 | from .linker import * 2 | -------------------------------------------------------------------------------- /pelican_comment_system/identicon/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /photos/__init__.py: -------------------------------------------------------------------------------- 1 | from .photos import * 2 | -------------------------------------------------------------------------------- /render_math/__init__.py: -------------------------------------------------------------------------------- 1 | from .math import * 2 | -------------------------------------------------------------------------------- /series/__init__.py: -------------------------------------------------------------------------------- 1 | from .series import * 2 | -------------------------------------------------------------------------------- /summary/__init__.py: -------------------------------------------------------------------------------- 1 | from .summary import * 2 | -------------------------------------------------------------------------------- /autopages/__init__.py: -------------------------------------------------------------------------------- 1 | from .autopages import * 2 | -------------------------------------------------------------------------------- /gzip_cache/__init__.py: -------------------------------------------------------------------------------- 1 | from .gzip_cache import * 2 | -------------------------------------------------------------------------------- /interlinks/__init__.py: -------------------------------------------------------------------------------- 1 | from .interlinks import * 2 | -------------------------------------------------------------------------------- /libravatar/__init__.py: -------------------------------------------------------------------------------- 1 | from . libravatar import * 2 | -------------------------------------------------------------------------------- /members/__init__.py: -------------------------------------------------------------------------------- 1 | from members import * # noqa 2 | -------------------------------------------------------------------------------- /multi_part/__init__.py: -------------------------------------------------------------------------------- 1 | from .multi_part import * 2 | -------------------------------------------------------------------------------- /neighbors/__init__.py: -------------------------------------------------------------------------------- 1 | from .neighbors import * 2 | -------------------------------------------------------------------------------- /org_reader/__init__.py: -------------------------------------------------------------------------------- 1 | from .org_reader import * 2 | -------------------------------------------------------------------------------- /photos/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow 2 | piexif>=1.0.5 3 | -------------------------------------------------------------------------------- /plantuml/__init__.py: -------------------------------------------------------------------------------- 1 | from .plantuml_rst import * 2 | -------------------------------------------------------------------------------- /post_stats/__init__.py: -------------------------------------------------------------------------------- 1 | from .post_stats import * 2 | -------------------------------------------------------------------------------- /rmd_reader/__init__.py: -------------------------------------------------------------------------------- 1 | from .rmd_reader import * 2 | -------------------------------------------------------------------------------- /share_post/__init__.py: -------------------------------------------------------------------------------- 1 | from .share_post import * 2 | -------------------------------------------------------------------------------- /sub_parts/__init__.py: -------------------------------------------------------------------------------- 1 | from .sub_parts import * 2 | -------------------------------------------------------------------------------- /test_data/content/unwanted_file: -------------------------------------------------------------------------------- 1 | not to be parsed 2 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/authors.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /thumbnailer/__init__.py: -------------------------------------------------------------------------------- 1 | from .thumbnailer import * -------------------------------------------------------------------------------- /author_images/__init__.py: -------------------------------------------------------------------------------- 1 | from .author_images import * 2 | -------------------------------------------------------------------------------- /category_meta/__init__.py: -------------------------------------------------------------------------------- 1 | from .category_meta import * 2 | -------------------------------------------------------------------------------- /clean_summary/__init__.py: -------------------------------------------------------------------------------- 1 | from .clean_summary import * 2 | -------------------------------------------------------------------------------- /code_include/__init__.py: -------------------------------------------------------------------------------- 1 | from .code_include import * 2 | -------------------------------------------------------------------------------- /creole_reader/__init__.py: -------------------------------------------------------------------------------- 1 | from .creole_reader import * 2 | -------------------------------------------------------------------------------- /disqus_static/__init__.py: -------------------------------------------------------------------------------- 1 | from .disqus_static import * 2 | -------------------------------------------------------------------------------- /extract_toc/__init__.py: -------------------------------------------------------------------------------- 1 | from .extract_toc import * 2 | -------------------------------------------------------------------------------- /feed_summary/__init__.py: -------------------------------------------------------------------------------- 1 | from .feed_summary import * 2 | -------------------------------------------------------------------------------- /footer_insert/__init__.py: -------------------------------------------------------------------------------- 1 | from .footer_insert import * 2 | -------------------------------------------------------------------------------- /i18n_subsites/__init__.py: -------------------------------------------------------------------------------- 1 | from .i18n_subsites import * 2 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/localized_theme/static/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jinja2content/__init__.py: -------------------------------------------------------------------------------- 1 | from .jinja2content import * 2 | -------------------------------------------------------------------------------- /liquid_tags/__init__.py: -------------------------------------------------------------------------------- 1 | from .liquid_tags import * 2 | -------------------------------------------------------------------------------- /md_inline_extension/__init__.py: -------------------------------------------------------------------------------- 1 | from .inline import * 2 | -------------------------------------------------------------------------------- /pelican-rdf/__init__.py: -------------------------------------------------------------------------------- 1 | from .pelican_rdf import * 2 | -------------------------------------------------------------------------------- /read_more_link/__init__.py: -------------------------------------------------------------------------------- 1 | from .read_more_link import * -------------------------------------------------------------------------------- /related_posts/__init__.py: -------------------------------------------------------------------------------- 1 | from .related_posts import * 2 | -------------------------------------------------------------------------------- /section_number/__init__.py: -------------------------------------------------------------------------------- 1 | from .section_number import * -------------------------------------------------------------------------------- /show_source/__init__.py: -------------------------------------------------------------------------------- 1 | from .show_source import * 2 | -------------------------------------------------------------------------------- /subcategory/__init__.py: -------------------------------------------------------------------------------- 1 | from .subcategory import * 2 | -------------------------------------------------------------------------------- /tag_cloud/__init__.py: -------------------------------------------------------------------------------- 1 | from .tag_cloud import * 2 | 3 | -------------------------------------------------------------------------------- /tipue_search/__init__.py: -------------------------------------------------------------------------------- 1 | from .tipue_search import * 2 | -------------------------------------------------------------------------------- /always_modified/__init__.py: -------------------------------------------------------------------------------- 1 | from .always_modified import * 2 | -------------------------------------------------------------------------------- /asciidoc_reader/__init__.py: -------------------------------------------------------------------------------- 1 | from .asciidoc_reader import * 2 | -------------------------------------------------------------------------------- /collate_content/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Python files 3 | *.pyc 4 | -------------------------------------------------------------------------------- /filetime_from_git/__init__.py: -------------------------------------------------------------------------------- 1 | from .registration import * 2 | -------------------------------------------------------------------------------- /gist_directive/__init__.py: -------------------------------------------------------------------------------- 1 | from gist_directive import * 2 | -------------------------------------------------------------------------------- /github_activity/__init__.py: -------------------------------------------------------------------------------- 1 | from .github_activity import * 2 | -------------------------------------------------------------------------------- /global_license/__init__.py: -------------------------------------------------------------------------------- 1 | from .global_license import * 2 | -------------------------------------------------------------------------------- /goodreads_activity/__init__.py: -------------------------------------------------------------------------------- 1 | from .goodreads_activity import * -------------------------------------------------------------------------------- /liquid_tags/test_data/pelicanhtml_2.tpl: -------------------------------------------------------------------------------- 1 | ../pelicanhtml_2.tpl -------------------------------------------------------------------------------- /liquid_tags/test_data/pelicanhtml_3.tpl: -------------------------------------------------------------------------------- 1 | ../pelicanhtml_3.tpl -------------------------------------------------------------------------------- /optimize_images/__init__.py: -------------------------------------------------------------------------------- 1 | from .optimize_images import * 2 | -------------------------------------------------------------------------------- /permalinks/__init__.py: -------------------------------------------------------------------------------- 1 | from .permalinks import register 2 | -------------------------------------------------------------------------------- /random_article/__init__.py: -------------------------------------------------------------------------------- 1 | from .random_article import * 2 | -------------------------------------------------------------------------------- /static_comments/__init__.py: -------------------------------------------------------------------------------- 1 | from .static_comments import * 2 | -------------------------------------------------------------------------------- /textile_reader/__init__.py: -------------------------------------------------------------------------------- 1 | from .textile_reader import * 2 | -------------------------------------------------------------------------------- /txt2tags_reader/__init__.py: -------------------------------------------------------------------------------- 1 | from .txt2tags_reader import * 2 | -------------------------------------------------------------------------------- /filetime_from_hg/__init__.py: -------------------------------------------------------------------------------- 1 | from .filetime_from_hg import * 2 | -------------------------------------------------------------------------------- /html_rst_directive/__init__.py: -------------------------------------------------------------------------------- 1 | from .html_rst_directive import * 2 | -------------------------------------------------------------------------------- /photos/test_data/agallery/captions.txt: -------------------------------------------------------------------------------- 1 | best.jpg: Caption-best 2 | -------------------------------------------------------------------------------- /simple_footnotes/__init__.py: -------------------------------------------------------------------------------- 1 | from .simple_footnotes import * 2 | -------------------------------------------------------------------------------- /custom_article_urls/__init__.py: -------------------------------------------------------------------------------- 1 | from .custom_article_urls import * 2 | -------------------------------------------------------------------------------- /googleplus_comments/__init__.py: -------------------------------------------------------------------------------- 1 | from .googleplus_comments import * 2 | -------------------------------------------------------------------------------- /representative_image/__init__.py: -------------------------------------------------------------------------------- 1 | from .representative_image import * 2 | -------------------------------------------------------------------------------- /pelican_comment_system/__init__.py: -------------------------------------------------------------------------------- 1 | from .pelican_comment_system import * 2 | -------------------------------------------------------------------------------- /video_privacy_enhancer/__init__.py: -------------------------------------------------------------------------------- 1 | from .video_privacy_enhancer import * 2 | -------------------------------------------------------------------------------- /better_figures_and_images/__init__.py: -------------------------------------------------------------------------------- 1 | from .better_figures_and_images import * 2 | -------------------------------------------------------------------------------- /test_data/content/extra/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /static/pictures 3 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/localized_theme/babel.cfg: -------------------------------------------------------------------------------- 1 | [jinja2: templates/**.html] 2 | 3 | -------------------------------------------------------------------------------- /photos/test_data/agallery/exif.txt: -------------------------------------------------------------------------------- 1 | best.jpg: EXIF-best 2 | night.png: EXIF-night 3 | -------------------------------------------------------------------------------- /w3c_validate/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from .wc3_validate import * 3 | -------------------------------------------------------------------------------- /yuicompressor/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from .yuicompressor import * 3 | -------------------------------------------------------------------------------- /sub_parts/test_data/noparent.md: -------------------------------------------------------------------------------- 1 | title: No parent 2 | tags: atag 3 | 4 | Normal article. 5 | -------------------------------------------------------------------------------- /better_codeblock_line_numbering/__init__.py: -------------------------------------------------------------------------------- 1 | from .better_codeblock_line_numbering import * 2 | -------------------------------------------------------------------------------- /liquid_tags/.gitignore: -------------------------------------------------------------------------------- 1 | .tox 2 | test_data/cache/ 3 | test_data/output/theme/ 4 | _nb_header.html 5 | -------------------------------------------------------------------------------- /tag_cloud/test_data/article_1.md: -------------------------------------------------------------------------------- 1 | Title: Article1 2 | tags: fun, pelican, plugins 3 | 4 | content, yeah! -------------------------------------------------------------------------------- /tag_cloud/test_data/article_4.md: -------------------------------------------------------------------------------- 1 | Title: Article4 2 | tags: pelican, fun 3 | 4 | content4, yeah! 5 | 6 | -------------------------------------------------------------------------------- /bootstrap-rst/140x140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/bootstrap-rst/140x140.png -------------------------------------------------------------------------------- /bootstrap-rst/171x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/bootstrap-rst/171x180.png -------------------------------------------------------------------------------- /bootstrap-rst/300x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/bootstrap-rst/300x200.png -------------------------------------------------------------------------------- /pelican_unity_webgl/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from .UnityGameDirective import register 4 | -------------------------------------------------------------------------------- /sub_parts/test_data/parent.md: -------------------------------------------------------------------------------- 1 | title: Parent 2 | tags: atag 3 | 4 | Parent article with two sub-articles. 5 | -------------------------------------------------------------------------------- /tag_cloud/test_data/article_3.md: -------------------------------------------------------------------------------- 1 | Title: Article3 2 | tags: pelican, plugins 3 | 4 | content3, yeah! 5 | 6 | -------------------------------------------------------------------------------- /test_data/content/cat1/article2.rst: -------------------------------------------------------------------------------- 1 | Article 2 2 | ######### 3 | 4 | :date: 2011-02-17 5 | 6 | Article 2 7 | -------------------------------------------------------------------------------- /test_data/content/cat1/article3.rst: -------------------------------------------------------------------------------- 1 | Article 3 2 | ######### 3 | 4 | :date: 2011-02-17 5 | 6 | Article 3 7 | -------------------------------------------------------------------------------- /tag_cloud/test_data/article_2.md: -------------------------------------------------------------------------------- 1 | Title: Article2 2 | tags: pelican, plugins, python 3 | 4 | content2, yeah! 5 | 6 | -------------------------------------------------------------------------------- /tag_cloud/test_data/article_5.md: -------------------------------------------------------------------------------- 1 | Title: Article5 2 | tags: plugins, pelican, fun 3 | 4 | content5, yeah! 5 | 6 | -------------------------------------------------------------------------------- /photos/SourceCodePro-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/photos/SourceCodePro-Bold.otf -------------------------------------------------------------------------------- /photos/SourceCodePro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/photos/SourceCodePro-Regular.otf -------------------------------------------------------------------------------- /photos/test_data/agallery/best.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/photos/test_data/agallery/best.jpg -------------------------------------------------------------------------------- /photos/test_data/agallery/night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/photos/test_data/agallery/night.png -------------------------------------------------------------------------------- /test_data/content/cat1/article1.rst: -------------------------------------------------------------------------------- 1 | Article 1 2 | ######### 3 | 4 | :date: 2011-02-17 5 | :yeah: oh yeah ! 6 | 7 | Article 1 8 | -------------------------------------------------------------------------------- /test_data/content/pictures/Sushi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/content/pictures/Sushi.jpg -------------------------------------------------------------------------------- /test_data/content/2012-11-30_filename-metadata.rst: -------------------------------------------------------------------------------- 1 | FILENAME_METADATA example 2 | ######################### 3 | 4 | Some cool stuff! 5 | -------------------------------------------------------------------------------- /test_data/content/pictures/Fat_Cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/content/pictures/Fat_Cat.jpg -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/tag.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | {% block title %}{{ SITENAME }} - {{ tag }}{% endblock %} 3 | -------------------------------------------------------------------------------- /thumbnailer/test_data/sample_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/thumbnailer/test_data/sample_image.jpg -------------------------------------------------------------------------------- /sub_parts/test_data/parent--implicit.md: -------------------------------------------------------------------------------- 1 | title: Implicit sub-article 2 | tags: atag 3 | 4 | Sub-article based on filename as implicit slug. 5 | -------------------------------------------------------------------------------- /test_data/content/pages/jinja2_template.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 | Some text 5 | 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /thumbnailer/test_data/expected_exact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/thumbnailer/test_data/expected_exact.jpg -------------------------------------------------------------------------------- /thumbnailer/test_data/expected_height.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/thumbnailer/test_data/expected_height.jpg -------------------------------------------------------------------------------- /thumbnailer/test_data/expected_square.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/thumbnailer/test_data/expected_square.jpg -------------------------------------------------------------------------------- /thumbnailer/test_data/expected_width.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/thumbnailer/test_data/expected_width.jpg -------------------------------------------------------------------------------- /test_data/content/pictures/Sushi_Macro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/content/pictures/Sushi_Macro.jpg -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/author.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | {% block title %}{{ SITENAME }} - {{ author }}{% endblock %} 3 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/category.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | {% block title %}{{ SITENAME }} - {{ category }}{% endblock %} 3 | -------------------------------------------------------------------------------- /twitter_bootstrap_rst_directives/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | from .bootstrap_rst_directives import * 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | ._* 3 | .*.swp 4 | .*.swo 5 | *.pyc 6 | *.log 7 | .DS_Store 8 | .directory 9 | .idea 10 | .project 11 | .pydevproject 12 | -------------------------------------------------------------------------------- /thumbnailer/test_data/subdir/sample_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/thumbnailer/test_data/subdir/sample_image.jpg -------------------------------------------------------------------------------- /assets/test_data/static/css/style.min.css: -------------------------------------------------------------------------------- 1 | body{font:14px/1.5 "Droid Sans",sans-serif;background-color:#e4e4e4;color:#242424}a{color:red}a:hover{color:orange} -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/pages/untranslated-page.rst: -------------------------------------------------------------------------------- 1 | Untranslated page 2 | ================= 3 | :lang: en 4 | 5 | This page has no translation. 6 | -------------------------------------------------------------------------------- /test_data/content/another_super_article-fr.rst: -------------------------------------------------------------------------------- 1 | Trop bien ! 2 | ########### 3 | 4 | :lang: fr 5 | :slug: oh-yeah 6 | 7 | Et voila du contenu en français 8 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/pages/hidden-page-en.rst: -------------------------------------------------------------------------------- 1 | A 404 page 2 | ========== 3 | :slug: 404 4 | :lang: en 5 | :status: hidden 6 | 7 | A simple 404 page. 8 | -------------------------------------------------------------------------------- /better_figures_and_images/test_data/dummy-200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/better_figures_and_images/test_data/dummy-200x200.png -------------------------------------------------------------------------------- /better_figures_and_images/test_data/dummy-250x300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/better_figures_and_images/test_data/dummy-250x300.png -------------------------------------------------------------------------------- /better_figures_and_images/test_data/dummy-800x300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/better_figures_and_images/test_data/dummy-800x300.png -------------------------------------------------------------------------------- /sub_parts/test_data/parent-explicit.md: -------------------------------------------------------------------------------- 1 | title: Explicit sub-article 2 | tags: atag 3 | slug: parent--explicit 4 | 5 | Explicit sub-article, based on explicit slug. 6 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/pages/hidden-page-cz.rst: -------------------------------------------------------------------------------- 1 | 404 stránka 2 | =========== 3 | :slug: 404 4 | :lang: cz 5 | :status: hidden 6 | 7 | Jednoduchá 404 stránka. 8 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/rss.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/vimeo.png -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/pages/hidden-page-de.rst: -------------------------------------------------------------------------------- 1 | Eine 404 Seite 2 | ============== 3 | :slug: 404 4 | :lang: de 5 | :status: hidden 6 | 7 | Eine einfache 404 Seite. 8 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/aboutme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/aboutme.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/github.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/gittip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/gittip.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/lastfm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/lastfm.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/reddit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/reddit.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/twitter.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/youtube.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/comments.html: -------------------------------------------------------------------------------- 1 | {% if DISQUS_SITENAME %}

There are comments.

{% endif %} 2 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/bitbucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/bitbucket.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/delicious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/delicious.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/facebook.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/gitorious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/gitorious.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/hackernews.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/hackernews.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/linkedin.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/slideshare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/slideshare.png -------------------------------------------------------------------------------- /bootstrap-rst/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/bootstrap-rst/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /bootstrap-rst/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/bootstrap-rst/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /bootstrap-rst/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/bootstrap-rst/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/google-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/google-plus.png -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/speakerdeck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/speakerdeck.png -------------------------------------------------------------------------------- /test_data/themes/simple/templates/category.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | {% block content_title %} 3 |

Articles in the {{ category }} category

4 | {% endblock %} 5 | 6 | -------------------------------------------------------------------------------- /photos/test_data/photo.md: -------------------------------------------------------------------------------- 1 | title: Test photo 2 | gallery: {photo}agallery 3 | image: {photo}agallery/best.jpg 4 | 5 | Here is my best photo, again. 6 | 7 | ![]({photo}agallery/best.jpg). 8 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/images/icons/google-groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/test_data/themes/notmyidea/static/images/icons/google-groups.png -------------------------------------------------------------------------------- /author_images/generate_hashsum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from __future__ import print_function 4 | import hashlib 5 | import sys 6 | 7 | print(hashlib.sha256(sys.argv[1]).hexdigest()) 8 | -------------------------------------------------------------------------------- /photos/test_data/filename.md: -------------------------------------------------------------------------------- 1 | title: Test filename 2 | gallery: {filename}agallery 3 | image: {filename}agallery/best.jpg 4 | 5 | Here is my best photo, again. 6 | 7 | ![]({filename}agallery/best.jpg). 8 | -------------------------------------------------------------------------------- /test_data/content/article2.rst: -------------------------------------------------------------------------------- 1 | Second article 2 | ############## 3 | 4 | :tags: foo, bar, baz 5 | :date: 2012-02-29 6 | :lang: en 7 | :slug: second-article 8 | 9 | This is some article, in english 10 | -------------------------------------------------------------------------------- /test_data/content/draft_article.rst: -------------------------------------------------------------------------------- 1 | A draft article 2 | ############### 3 | 4 | :status: draft 5 | 6 | This is a draft article, it should live under the /drafts/ folder and not be 7 | listed anywhere else. 8 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/localized_theme/translations/de/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NicolasLM/pelican-plugins/HEAD/i18n_subsites/test_data/localized_theme/translations/de/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /test_data/content/article2-fr.rst: -------------------------------------------------------------------------------- 1 | Deuxième article 2 | ################ 3 | 4 | :tags: foo, bar, baz 5 | :date: 2012-02-29 6 | :lang: fr 7 | :slug: second-article 8 | 9 | Ceci est un article, en français. 10 | -------------------------------------------------------------------------------- /collate_content/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | __init__.py 3 | =========== 4 | 5 | Edward J. Stronge 6 | (c) 2014 7 | 8 | Imports collate_content to facilitate Pelican's plugin loading process. 9 | """ 10 | from .collate_content import * 11 | -------------------------------------------------------------------------------- /touch/README.rst: -------------------------------------------------------------------------------- 1 | Touch plugin 2 | ############ 3 | 4 | A simple plugin doing a touch on your generated files using the date metadata 5 | from the content. 6 | 7 | This helps, into other things, to have the web server gently manage the cache. 8 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/css/typogrify.css: -------------------------------------------------------------------------------- 1 | .caps {font-size:.92em;} 2 | .amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} 3 | .dquo {margin-left:-.38em;} 4 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/author.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | 3 | {% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %} 4 | {% block content_title %} 5 |

Articles by {{ author }}

6 | {% endblock %} 7 | 8 | -------------------------------------------------------------------------------- /asciidoc_reader/test_data/article_with_asc_options.asc: -------------------------------------------------------------------------------- 1 | Test AsciiDoc File Header 2 | ========================= 3 | 4 | Used for pelican test 5 | --------------------- 6 | 7 | version {revision} 8 | 9 | The quick brown fox jumped over the lazy dog's back. 10 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/translated_article-cz.rst: -------------------------------------------------------------------------------- 1 | Přeložený článek 2 | ================ 3 | :slug: translated-article 4 | :lang: cz 5 | :date: 2014-09-15 6 | 7 | Jednoduchý článek s překlady. 8 | Zde je odkaz na `nějaký obrázek <{filename}/images/img.png>`_. 9 | -------------------------------------------------------------------------------- /test_data/content/pages/test_page.rst: -------------------------------------------------------------------------------- 1 | This is a test page 2 | ################### 3 | 4 | :category: test 5 | 6 | Just an image. 7 | 8 | .. image:: |filename|/pictures/Fat_Cat.jpg 9 | :height: 450 px 10 | :width: 600 px 11 | :alt: alternate text 12 | 13 | -------------------------------------------------------------------------------- /global_license/Readme.rst: -------------------------------------------------------------------------------- 1 | Global license 2 | -------------- 3 | 4 | This plugin allows you to define a ``LICENSE`` setting and adds the contents of that 5 | license variable to the article's context, making that variable available to use 6 | from within your theme's templates. 7 | -------------------------------------------------------------------------------- /pelican_unity_webgl/config.py: -------------------------------------------------------------------------------- 1 | # unity webgl options 2 | 3 | DEFAULT_WIDTH = 960 4 | DEFAULT_HEIGHT = 600 5 | DEFAULT_ALIGN = 'center' 6 | 7 | # paths 8 | 9 | GAMES_ROOT_DIR = '/games' # directory with games 10 | TEMPLATE_PATH = '/games/utemplate' # template path 11 | -------------------------------------------------------------------------------- /test_data/content/pages/hidden_page.rst: -------------------------------------------------------------------------------- 1 | This is a test hidden page 2 | ########################## 3 | 4 | :category: test 5 | :status: hidden 6 | 7 | This is great for things like error(404) pages 8 | Anyone can see this page but it's not linked to anywhere! 9 | 10 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/translated_article-en.rst: -------------------------------------------------------------------------------- 1 | A translated article 2 | ==================== 3 | :slug: translated-article 4 | :lang: en 5 | :date: 2014-09-13 6 | 7 | A simple article with a translation. 8 | Here is a link to `some image <{filename}/images/img.png>`_. 9 | -------------------------------------------------------------------------------- /test_data/content/cat1/markdown-article.md: -------------------------------------------------------------------------------- 1 | Title: A markdown powered article 2 | Date: 2011-04-20 3 | 4 | You're mutually oblivious. 5 | 6 | [a root-relative link to unbelievable](|filename|/unbelievable.rst) 7 | [a file-relative link to unbelievable](|filename|../unbelievable.rst) 8 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/categories.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /test_data/content/pages/override_url_saveas.rst: -------------------------------------------------------------------------------- 1 | Override url/save_as 2 | #################### 3 | 4 | :date: 2012-12-07 5 | :url: override/ 6 | :save_as: override/index.html 7 | 8 | Test page which overrides save_as and url so that this page will be generated 9 | at a custom location. 10 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/taglist.html: -------------------------------------------------------------------------------- 1 | {% if article.tags %}

tags: {% for tag in article.tags %}{{ tag }}{% endfor %}

{% endif %} 2 | {% if PDF_PROCESSOR %}

get the pdf

{% endif %} 3 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/translated_article-de.rst: -------------------------------------------------------------------------------- 1 | Ein übersetzter Artikel 2 | ======================= 3 | :slug: translated-article 4 | :lang: de 5 | :date: 2014-09-14 6 | 7 | Ein einfacher Artikel mit einer Übersetzung. 8 | Hier ist ein Link zur `einigem Bild <{filename}/images/img.png>`_. 9 | -------------------------------------------------------------------------------- /assets/test_data/templates/base.html: -------------------------------------------------------------------------------- 1 | {% extends "!simple/base.html" %} 2 | 3 | {% block head %} 4 | {% assets filters="scss,cssmin", output="gen/style.%(version)s.min.css", "css/style.scss" %} 5 | 6 | {% endassets %} 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/twitter.html: -------------------------------------------------------------------------------- 1 | {% if TWITTER_USERNAME %} 2 | Tweet 3 | {% endif %} -------------------------------------------------------------------------------- /i18n_subsites/test_data/content/untranslated_article-en.rst: -------------------------------------------------------------------------------- 1 | An untranslated article 2 | ======================= 3 | :date: 2014-07-14 4 | :lang: en 5 | 6 | An article without a translation. 7 | Here is a link to an `untranslated page`_ 8 | 9 | .. _`untranslated page`: {filename}/pages/untranslated-page.rst 10 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/localized_theme/templates/base.html: -------------------------------------------------------------------------------- 1 | {% extends "!simple/base.html" %} 2 | 3 | {% block title %}{% trans %}Welcome to our{% endtrans %} {{ SITENAME }}{% endblock %} 4 | {% block head %} 5 | {{ super() }} 6 | 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /test_data/content/unbelievable.rst: -------------------------------------------------------------------------------- 1 | Unbelievable ! 2 | ############## 3 | 4 | :date: 2010-10-15 20:30 5 | 6 | Or completely awesome. Depends the needs. 7 | 8 | `a root-relative link to markdown-article <|filename|/cat1/markdown-article.md>`_ 9 | `a file-relative link to markdown-article <|filename|cat1/markdown-article.md>`_ 10 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/translations.html: -------------------------------------------------------------------------------- 1 | {% macro translations_for(article) %} 2 | {% if article.translations %} 3 | Translations: 4 | {% for translation in article.translations %} 5 | {{ translation.lang }} 6 | {% endfor %} 7 | {% endif %} 8 | {% endmacro %} 9 | 10 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/translations.html: -------------------------------------------------------------------------------- 1 | {% macro translations_for(article) %} 2 | {% if article.translations %} 3 | Translations: 4 | {% for translation in article.translations %} 5 | {{ translation.lang }} 6 | {% endfor %} 7 | {% endif %} 8 | {% endmacro %} 9 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block title %}{{ page.title }}{%endblock%} 3 | {% block content %} 4 |

{{ page.title }}

5 | {% import 'translations.html' as translations with context %} 6 | {{ translations.translations_for(page) }} 7 | 8 | {{ page.content }} 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /liquid_tags/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | skipsdist = True 3 | minversion = 1.8 4 | envlist = 5 | py{27,34}-ipython2, 6 | py{27,34}-ipython3, 7 | 8 | [testenv] 9 | commands = py.test 10 | 11 | deps = 12 | pytest 13 | pytest-capturelog 14 | pelican 15 | markdown 16 | mock 17 | ipython2: ipython[notebook]>=2,<3 18 | ipython3: ipython[notebook] 19 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/archives.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |

Archives for {{ SITENAME }}

4 | 5 |
6 | {% for article in dates %} 7 |
{{ article.locale_date }}
8 |
{{ article.title }}
9 | {% endfor %} 10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /interlinks/test_data/testme.md: -------------------------------------------------------------------------------- 1 | Title: Testing 2 | Date: 3000-07-09 3 | Slug: plugin-test 4 | 5 | Testeando un poco la cosa 6 | 7 | [Normal boring link](http://www.example.com). But this is a [cool link](this>) that links to this site. 8 | 9 | Search in [Wikipedia](wikipedia_en>python), ([here](wikipedia_es>python) in spanish). Also can [search](ddg>python) it. 10 | -------------------------------------------------------------------------------- /asciidoc_reader/test_data/article_with_asc_extension.asc: -------------------------------------------------------------------------------- 1 | Test AsciiDoc File Header 2 | ========================= 3 | :Author: Author O. Article 4 | :Email: 5 | :Date: 2011-09-15 09:05 6 | :Category: Blog 7 | :Tags: Linux, Python, Pelican 8 | 9 | Used for pelican test 10 | --------------------- 11 | 12 | The quick brown fox jumped over the lazy dog's back. 13 | -------------------------------------------------------------------------------- /libravatar/test_data/theme/templates/article.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 | {% if article.author_libravatar %} 6 |
7 | 8 |
9 | {% endif %} 10 |
11 |
12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /bootstrap-rst/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __title__ = 'bootstrap-rst' 3 | __version__ = '0.1.1' 4 | __author__ = 'Nicolas P. Rougier' 5 | __credits__ = ['Nicolas P. Rougier', 'Alex Waite', 'Trevor Morgan'] 6 | __maintainer__ = "Alex Waite" 7 | __email__ = "alex@waite.eu" 8 | __status__ = "Development" 9 | __license__ = 'MIT' 10 | __copyright__ = 'Copyright 2014' 11 | 12 | from .bootstrap import * 13 | -------------------------------------------------------------------------------- /assets/test_data/static/css/style.scss: -------------------------------------------------------------------------------- 1 | /* -*- scss-compile-at-save: nil -*- */ 2 | 3 | $baseFontFamily : "Droid Sans", sans-serif; 4 | $textColor : #242424; 5 | $bodyBackground : #e4e4e4; 6 | 7 | body { 8 | font: 14px/1.5 $baseFontFamily; 9 | background-color: $bodyBackground; 10 | color: $textColor; 11 | } 12 | 13 | a { 14 | color: red; 15 | 16 | &:hover { 17 | color: orange; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pelican-rdf/sparql-queries/lov_metadata.sparql: -------------------------------------------------------------------------------- 1 | PREFIX owl: 2 | PREFIX dc: 3 | PREFIX cc: 4 | SELECT ?iri ?license ?description ?version ?title 5 | WHERE { 6 | ?iri rdf:type owl:Ontology; 7 | cc:license ?license; 8 | dc:description ?description; 9 | dc:title ?title; 10 | owl:versionInfo ?version. 11 | } LIMIT 1 -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/archives.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |

Archives for {{ SITENAME }}

5 | 6 |
7 | {% for article in dates %} 8 |
{{ article.locale_date }}
9 |
{{ article.title }}
10 | {% endfor %} 11 |
12 |
13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /linker/content_objects.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from pelican import signals 3 | 4 | def initialize_content_object_set(app): 5 | app.settings['content_objects'] = set() 6 | 7 | def collect_content_objects(co): 8 | context = co._context['content_objects'].add(co) 9 | 10 | def register(): 11 | signals.initialized.connect(initialize_content_object_set) 12 | signals.content_object_init.connect(collect_content_objects) 13 | -------------------------------------------------------------------------------- /txt2tags_reader/README.md: -------------------------------------------------------------------------------- 1 | # txt2tags_reader 2 | A [txt2tags] reader plugin for the [Pelican static site generator](http://docs.getpelican.com/en/latest/). 3 | 4 | Requirements 5 | ------------ 6 | [txt2tags] in $PATH 7 | 8 | Installation 9 | ------------ 10 | Instructions on installing pelican plugins can be found in the [pelican plugin manual](https://github.com/getpelican/pelican-plugins/blob/master/Readme.rst). 11 | 12 | [txt2tags]:http://txt2tags.org/ 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | - "3.2" 5 | before_install: 6 | - sudo apt-get update -qq 7 | - sudo apt-get install -qq --no-install-recommends ruby-sass 8 | install: 9 | - pip install nose 10 | - pip install -e git://github.com/getpelican/pelican.git#egg=pelican 11 | - pip install --use-mirrors Markdown 12 | - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install --use-mirrors webassets cssmin; fi 13 | script: nosetests 14 | -------------------------------------------------------------------------------- /pelican-rdf/sparql-queries/classes.sparql: -------------------------------------------------------------------------------- 1 | PREFIX owl: 2 | PREFIX dc: 3 | PREFIX cc: 4 | PREFIX rdfs: 5 | 6 | SELECT ?class ?comment ?label 7 | WHERE { 8 | ?class rdf:type owl:Class. 9 | OPTIONAL { ?class rdfs:comment ?comment.} 10 | OPTIONAL { ?label rdfs:label ?label.} 11 | OPTIONAL { ?class rdfs:subClassOf ?superclass.} 12 | } GROUP BY ?class -------------------------------------------------------------------------------- /test_data/content/another_super_article.rst: -------------------------------------------------------------------------------- 1 | Oh yeah ! 2 | ######### 3 | 4 | :tags: oh, bar, yeah 5 | :date: 2010-10-20 10:14 6 | :category: bar 7 | :author: Alexis Métaireau 8 | :slug: oh-yeah 9 | :license: WTFPL 10 | 11 | Why not ? 12 | ========= 13 | 14 | After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! 15 | YEAH ! 16 | 17 | .. image:: |filename|/pictures/Sushi.jpg 18 | :height: 450 px 19 | :width: 600 px 20 | :alt: alternate text 21 | -------------------------------------------------------------------------------- /pelican_comment_system/identicon/README.md: -------------------------------------------------------------------------------- 1 | identicon.py: identicon python implementation. 2 | ============================================== 3 | :Author:Shin Adachi 4 | 5 | ## usage 6 | 7 | ### commandline 8 | 9 | python identicon.py [code] 10 | 11 | ### python 12 | 13 | import identicon 14 | identicon.render_identicon(code, size) 15 | 16 | Return a PIL Image class instance which have generated identicon image. 17 | `size` specifies patch size. Generated image size is 3 * `size`. -------------------------------------------------------------------------------- /test_data/Readme.rst: -------------------------------------------------------------------------------- 1 | Test Data 2 | --------- 3 | 4 | Place tests for your plugin here. ``test_data`` folder contains following 5 | common data for your tests, if you need them. 6 | 7 | =============== =========================== 8 | File/Folder Description 9 | =============== =========================== 10 | content A sample content folder 11 | themes Default themes from Pelican 12 | pelican.conf.py A sample settings file 13 | =============== =========================== 14 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-badges.txt: -------------------------------------------------------------------------------- 1 | Badges 2 | =============================================================================== 3 | .. lead:: Easily highlight new or unread items by adding a 4 | to links, Bootstrap navs, and more. 5 | 6 | 7 | .. container:: bs-example 8 | 9 | `Inbox <#>`_ :badge:`42` 10 | 11 | 12 | Self collapsing 13 | 14 | When there are no new or unread items, badges will simply collapse (via CSS's 15 | `:empty` selector) provided no content exists within. 16 | -------------------------------------------------------------------------------- /pelican_unity_webgl/template.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 |
9 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/github.html: -------------------------------------------------------------------------------- 1 | {% if GITHUB_URL %} 2 | 3 | {% if GITHUB_POSITION != "left" %} 4 | Fork me on GitHub 5 | {% else %} 6 | Fork me on GitHub 7 | {% endif %} 8 | 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /yuicompressor/README.md: -------------------------------------------------------------------------------- 1 | # YUI Compressor Plugin 2 | 3 | A pelican plugin which minify through yui compressor CSS/JS file on building step. 4 | 5 | # Installation 6 | 7 | In order to work, JRE should be already installed. 8 | Please add `pip install yuicompressor` 9 | 10 | More info : (https://github.com/yui/yuicompressor) 11 | 12 | # Instructions 13 | 14 | Add `yuicompressor` to `pelicanconf.py` after install : 15 | `PLUGINS = ['yuicompressor']` 16 | 17 | # Licence 18 | 19 | GNU AFFERO GENERAL PUBLIC LICENSE Version 3 20 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/disqus_script.html: -------------------------------------------------------------------------------- 1 | {% if DISQUS_SITENAME %} 2 | 11 | {% endif %} 12 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block title %}{{ page.title }}{% endblock %} 3 | {% block content %} 4 |
5 |

{{ page.title }}

6 | {% import 'translations.html' as translations with context %} 7 | {{ translations.translations_for(page) }} 8 | {% if PDF_PROCESSOR %}get 9 | the pdf{% endif %} 10 | {{ page.content }} 11 |
12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /always_modified/README.md: -------------------------------------------------------------------------------- 1 | # Always Modified 2 | 3 | Say you want to sort by modified date/time in a theme template, but not all 4 | your articles have modified date/timestamps explicitly defined in article 5 | metadata. This plugin facilitates that sorting by assuming the modified date 6 | (if undefined) is equal to the created date. 7 | 8 | ## Usage 9 | 10 | 1. Add `ALWAYS_MODIFIED = True` to your settings file. 11 | 2. Now you can sort by modified date in your templates: 12 | 13 | {% for article in articles|sort(reverse=True,attribute='modified') %} 14 | 15 | -------------------------------------------------------------------------------- /random_article/Readme.md: -------------------------------------------------------------------------------- 1 | Random Article Plugin For Pelican 2 | ======================== 3 | 4 | This plugin generates a html file which redirect to a random article 5 | using javascript's `window.location`. The generated html file is 6 | saved at `SITEURL`. 7 | 8 | Only published articles are listed to redirect. 9 | 10 | Usage 11 | ----- 12 | 13 | To use it you have to add in your config file the name of the file to use: 14 | 15 | RANDOM = 'random.html' 16 | 17 | Then in some template you add: 18 | 19 | random article 20 | -------------------------------------------------------------------------------- /footer_insert/README.md: -------------------------------------------------------------------------------- 1 | # Footer Insert 2 | 3 | This plugin allows you to insert a `FOOTER_INSERT_HTML` to the end of the blog. 4 | 5 | eg. add authors / blog infomation to every blog. 6 | 7 | ## Usage 8 | 9 | 1. Insert `FOOTER_INSERT_HTML` to your `pelicanconf.py`. You can use 10 | title / url / author / authors / slug / category / summary 11 | / date infomation in the config like this: `%(title)s`. 12 | 2. Insert this code to your artical template file, eg. `templates/article.html`: 13 | ``` 14 | {% if article.footer_insert_html %} 15 | {{ article.footer_insert_html }} 16 | {% endif %} 17 | ``` 18 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/bootstrap-roles.txt: -------------------------------------------------------------------------------- 1 | .. ---------------------------------------------------------------------------- 2 | .. Bootstrap RST - role definitions 3 | .. ---------------------------------------------------------------------------- 4 | 5 | .. role:: small 6 | .. role:: kbd 7 | .. role:: badge 8 | 9 | .. role:: text-muted 10 | .. role:: text-primary 11 | .. role:: text-success 12 | .. role:: text-info 13 | .. role:: text-warning 14 | .. role:: text-danger 15 | 16 | .. role:: bg-muted 17 | .. role:: bg-primary 18 | .. role:: bg-success 19 | .. role:: bg-info 20 | .. role:: bg-warning 21 | .. role:: bg-danger 22 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/analytics.html: -------------------------------------------------------------------------------- 1 | {% if GOOGLE_ANALYTICS %} 2 | 12 | {% endif %} -------------------------------------------------------------------------------- /googleplus_comments/Readme.md: -------------------------------------------------------------------------------- 1 | GooglePlus Comments Plugin For Pelican 2 | ================================== 3 | 4 | Adds GooglePlus comments to Pelican 5 | 6 | Add the plugin to `pelicanconf.py`: 7 | 8 | PLUGIN_PATH = 'pelican-plugins' 9 | PLUGINS = ["googleplus_comments"] 10 | 11 | Add a `
` for comments to the `article.html` of your template: 12 | 13 |
14 |
15 |
16 | {{ article.metadata.googleplus_comments }} 17 | 18 | See it working, and ask for support: 19 | 20 | 21 | -------------------------------------------------------------------------------- /global_license/global_license.py: -------------------------------------------------------------------------------- 1 | """ 2 | License plugin for Pelican 3 | ========================== 4 | 5 | This plugin allows you to define a LICENSE setting and adds the contents of that 6 | license variable to the article's context, making that variable available to use 7 | from within your theme's templates. 8 | """ 9 | 10 | from pelican import signals 11 | 12 | def add_license(generator, metadata): 13 | if 'license' not in metadata.keys()\ 14 | and 'LICENSE' in generator.settings.keys(): 15 | metadata['license'] = generator.settings['LICENSE'] 16 | 17 | def register(): 18 | signals.article_generator_context.connect(add_license) 19 | -------------------------------------------------------------------------------- /gist_directive/README.rst: -------------------------------------------------------------------------------- 1 | Pelican ``gist_directive`` plugin 2 | ================================= 3 | 4 | This plugin adds a ``gist`` reStructuredText directive. Eg:: 5 | 6 | .. gist:: ionelmc/eb11afbcca187bad5273 setup.py python 7 | 8 | It will download (with cache) and include the gist contents in the document. 9 | 10 | .. note:: 11 | 12 | It also supports embedding content from github directly. 13 | 14 | Example, to include ``https://raw.githubusercontent.com/ionelmc/cookiecutter-pylibrary/master/%7B%7Bcookiecutter.repo_name%7D%7D/setup.py``:: 15 | 16 | .. github:: ionelmc/cookiecutter-pylibrary master/{{cookiecutter.repo_name}}/setup.py 17 | 18 | -------------------------------------------------------------------------------- /liquid_tags/test_data/content/test-ipython-notebook-nbformat3.md: -------------------------------------------------------------------------------- 1 | Title: test ipython notebook nb format 3 2 | Date: 2015-03-03 3 | Authors: Testing Man 4 | 5 | 6 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 7 | tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At 8 | vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, 9 | no sea takimata sanctus est Lorem ipsum dolor sit amet. 10 | 11 | #Loading an entire notebook nbformat = 3.0 12 | 13 | {% notebook test_nbformat3.ipynb %} 14 | 15 | #Loading selected cells from a notebook nbformat = 3.0 16 | 17 | {% notebook test_nbformat3.ipynb cells[1:5] %} 18 | -------------------------------------------------------------------------------- /liquid_tags/test_data/content/test-ipython-notebook-nbformat4.md: -------------------------------------------------------------------------------- 1 | Title: test ipython notebook nb format 4 2 | Date: 2015-03-03 3 | Authors: Testing Man 4 | 5 | 6 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 7 | tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At 8 | vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, 9 | no sea takimata sanctus est Lorem ipsum dolor sit amet. 10 | 11 | #Loading an entire notebook nbformat = 4.0 12 | 13 | {% notebook test_nbformat4.ipynb %} 14 | 15 | #Loading selected cells from a notebook nbformat = 4.0 16 | 17 | {% notebook test_nbformat4.ipynb cells[1:5] %} 18 | -------------------------------------------------------------------------------- /always_modified/always_modified.py: -------------------------------------------------------------------------------- 1 | """ 2 | If "modified" date/time is not defined in article metadata, fall back to the "created" date. 3 | """ 4 | 5 | from pelican import signals 6 | from pelican.contents import Content, Article 7 | 8 | def add_modified(content): 9 | if not isinstance(content, Article): 10 | return 11 | 12 | if not content.settings.get('ALWAYS_MODIFIED', False): 13 | return 14 | 15 | if hasattr(content, 'date') and not hasattr(content, 'modified'): 16 | content.modified = content.date 17 | content.locale_modified = content.locale_date 18 | 19 | def register(): 20 | signals.content_object_init.connect(add_modified) 21 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/gosquared.html: -------------------------------------------------------------------------------- 1 | {% if GOSQUARED_SITENAME %} 2 | 14 | {% endif %} 15 | -------------------------------------------------------------------------------- /gzip_cache/Readme.rst: -------------------------------------------------------------------------------- 1 | Gzip cache 2 | ---------- 3 | 4 | Certain web servers (e.g., Nginx) can use a static cache of gzip-compressed 5 | files to prevent the server from compressing files during an HTTP call. Since 6 | compression occurs at another time, these compressed files can be compressed 7 | at a higher compression level for increased optimization. 8 | 9 | The ``gzip_cache`` plugin compresses all common text type files into a ``.gz`` 10 | file within the same directory as the original file. 11 | 12 | Settings 13 | -------- 14 | 15 | * `GZIP_CACHE_OVERWRITE` 16 | If True, the original files will be replaced by the gzip-compressed files. 17 | This is useful for static hosting services (e.g S3). Defaults to False. -------------------------------------------------------------------------------- /github-wiki/wiki.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function() { 2 | document.querySelector(".wiki-nav-button").addEventListener('click', function(event) { 3 | document.querySelector(".wiki-links").classList.toggle('nodisplay'); 4 | event.target.text = event.target.text == "Expand Menu" ? "Collapse Menu" : "Expand Menu"; 5 | }, false); 6 | var expanders = document.querySelectorAll(".wiki-dir-expander"); 7 | for (i = 0; i < expanders.length; ++i) { 8 | expanders[i].addEventListener('click', function(event) { 9 | event.target.parentElement.nextSibling.nextSibling.classList.toggle("nodisplay"); 10 | event.target.text = event.target.text == "+" ? "-" : "+"; 11 | }, false); 12 | }; 13 | }, false); 14 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/pagination.html: -------------------------------------------------------------------------------- 1 | {% if DEFAULT_PAGINATION %} 2 |

3 | {% if articles_page.has_previous() %} 4 | {% if articles_page.previous_page_number() == 1 %} 5 | « 6 | {% else %} 7 | « 8 | {% endif %} 9 | {% endif %} 10 | Page {{ articles_page.number }} / {{ articles_paginator.num_pages }} 11 | {% if articles_page.has_next() %} 12 | » 13 | {% endif %} 14 |

15 | {% endif %} 16 | -------------------------------------------------------------------------------- /headerid/README.rst: -------------------------------------------------------------------------------- 1 | Pelican ``headerid`` plugin 2 | =========================== 3 | 4 | This plugin adds an anchor to each heading so you can deep-link to headers. 5 | It is intended for formats such as reStructuredText that do not natively 6 | generate these anchors. 7 | 8 | The ``HEADERID_LINK_CHAR`` config can be set to use a different char from ``*`` 9 | for anchor text. 10 | 11 | For Markdown, this plugin is less relevant since the Python-Markdown library 12 | includes a Table of Contents extension that will generate link anchors. 13 | To enable the ``toc`` extension, add a line similar to the following example 14 | to your Pelican settings file:: 15 | 16 | MD_EXTENSIONS = ["codehilite(css_class=highlight)", "extra", "toc"] 17 | -------------------------------------------------------------------------------- /html_rst_directive/html_rst_directive.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | HTML tags for reStructuredText 4 | ============================== 5 | 6 | This plugin allows you to use HTML tags from within reST documents. 7 | 8 | """ 9 | 10 | from __future__ import unicode_literals 11 | from docutils import nodes 12 | from docutils.parsers.rst import directives, Directive 13 | 14 | 15 | class RawHtml(Directive): 16 | required_arguments = 0 17 | optional_arguments = 0 18 | final_argument_whitespace = True 19 | has_content = True 20 | 21 | def run(self): 22 | html = ' '.join(self.content) 23 | node = nodes.raw('', html, format='html') 24 | return [node] 25 | 26 | 27 | 28 | def register(): 29 | directives.register_directive('html', RawHtml) 30 | 31 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/localized_theme/messages.pot: -------------------------------------------------------------------------------- 1 | # Translations template for PROJECT. 2 | # Copyright (C) 2014 ORGANIZATION 3 | # This file is distributed under the same license as the PROJECT project. 4 | # FIRST AUTHOR , 2014. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PROJECT VERSION\n" 10 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 11 | "POT-Creation-Date: 2014-07-13 12:25+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 1.3\n" 19 | 20 | #: templates/base.html:3 21 | msgid "Welcome to our" 22 | msgstr "" 23 | 24 | -------------------------------------------------------------------------------- /liquid_tags/literal.py: -------------------------------------------------------------------------------- 1 | """ 2 | Literal Tag 3 | ----------- 4 | This implements a tag that allows explicitly showing commands which would 5 | otherwise be interpreted as a liquid tag. 6 | 7 | For example, the line 8 | 9 | {% literal video arg1 arg2 %} 10 | 11 | would result in the following line: 12 | 13 | {% video arg1 arg2 %} 14 | 15 | This is useful when the resulting line would be interpreted as another 16 | liquid-style tag. 17 | """ 18 | from .mdx_liquid_tags import LiquidTags 19 | 20 | @LiquidTags.register('literal') 21 | def literal(preprocessor, tag, markup): 22 | return '{%% %s %%}' % markup 23 | 24 | #---------------------------------------------------------------------- 25 | # This import allows image tag to be a Pelican plugin 26 | from liquid_tags import register 27 | 28 | -------------------------------------------------------------------------------- /textile_reader/Readme.textile: -------------------------------------------------------------------------------- 1 | h1. Textile Reader Plugin for Pelican 2 | 3 | p. This plugin adds support for "Textile markup":https://github.com/netcarver/textile via the "textile egg on pypi":https://pypi.python.org/pypi/textile . 4 | 5 | p. Input files are similar in format to Markdown files, in that they start with the post metadata in "Key: value" pairs, one per line. However, the metadata is ended by a line containing only "----", and then all that follows is the body content. If the separator line is missing then the whole file is assumed to be content. 6 | 7 | h2. Example Input File 8 | 9 |
Title: An Example Textile-formatted Input for Pelican
10 | Date: 2013-08-12
11 | Category: Plugins
12 | Tags: textile, pelican
13 | Author: Joey Coleman
14 | ----
15 | p. Lorem ipsum dolor sit amet...
16 | 
17 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-page-header.txt: -------------------------------------------------------------------------------- 1 | Page header 2 | =============================================================================== 3 | 4 | A simple shell for an `h1` to appropriately space out and segment sections of 5 | content on a page. It can utilize the `h1`'s default `small` element, as well as 6 | most other components (with additional styles). 7 | 8 | 9 | 10 | .. lead:: Easily highlight new or unread items by adding a 11 | to links, Bootstrap navs, and more. 12 | 13 | 14 | .. container:: bs-example 15 | 16 | .. container:: page-header 17 | 18 | :h1:`Example page header Subtext for header` 19 | 20 | 21 | .. code:: 22 | :class: highlight 23 | 24 | .. page-header:: 25 | 26 | :h1:`Example page header Subtext for header` 27 | -------------------------------------------------------------------------------- /gravatar/Readme.rst: -------------------------------------------------------------------------------- 1 | Gravatar 2 | -------- 3 | 4 | This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and 5 | makes the variable available within the article's context. You can add 6 | ``AUTHOR_EMAIL`` to your settings file to define the default author's email 7 | address. Obviously, that email address must be associated with a Gravatar 8 | account. 9 | 10 | Alternatively, you can provide an email address from within article metadata. 11 | 12 | In reSTructuredText:: 13 | 14 | :email: john.doe@example.com 15 | 16 | In Markdown:: 17 | 18 | Email: john.doe@example.com 19 | 20 | If the email address is defined via at least one of the two methods above, the 21 | ``author_gravatar`` variable is added to the article's context. For Markdown, 22 | it is critical that the 'E' in ``Email`` is capitalized. 23 | 24 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/article_infos.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{ article.locale_date }} 4 | 5 | 6 | {% if article.author %} 7 |
8 | By {{ article.author }} 9 |
10 | {% endif %} 11 |

In {{ article.category }}. {% if PDF_PROCESSOR %}get the pdf{% endif %}

12 | {% include 'taglist.html' %} 13 | {% import 'translations.html' as translations with context %} 14 | {{ translations.translations_for(article) }} 15 |
16 | -------------------------------------------------------------------------------- /read_more_link/Readme.md: -------------------------------------------------------------------------------- 1 | Read More Link 2 | === 3 | 4 | **Author**: Vuong Nguyen (http://vuongnguyen.com) 5 | 6 | This plugin inserts an inline "read more" or "continue" link into the last html element of the object summary. 7 | 8 | For more information, please visit: http://vuongnguyen.com/creating-inline-read-more-link-python-pelican-lxml.html 9 | 10 | Requirements 11 | --- 12 | 13 | lxml - for parsing html elements 14 | 15 | Settings 16 | --- 17 | # This settings indicates that you want to create summary at a certain length 18 | SUMMARY_MAX_LENGTH = 50 19 | 20 | # This indicates what goes inside the read more link 21 | READ_MORE_LINK = None (ex: 'continue') 22 | 23 | # This is the format of the read more link 24 | READ_MORE_LINK_FORMAT = '{text}' 25 | 26 | 27 | -------------------------------------------------------------------------------- /html_entity/README.rst: -------------------------------------------------------------------------------- 1 | HTML Entities for reStructuredText 2 | ################################## 3 | 4 | This plugin allows you to enter HTML entities such as ©, <, • inline in a RST document, as opposed 5 | to the tedious method of creating substitution definitions. 6 | 7 | Roles 8 | ===== 9 | 10 | Adds one inline role: 11 | 12 | :: 13 | 14 | :html_entity: 15 | 16 | Usage 17 | ===== 18 | 19 | :: 20 | 21 | :html_entity:`copy` 2013 :html_entity:`lt` Pelican :html_entity:`gt` Industries :html_entity:`149` All Rights Reserved 22 | 23 | produces: 24 | 25 | |copy| 2013 |lt| Pelican |gt| Industries |bullet| All Rights Reserved 26 | 27 | .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN 28 | .. |lt| unicode:: U+003C .. LESS THAN 29 | .. |gt| unicode:: U+003E .. GREATER THAN 30 | .. |bullet| unicode:: U+2022 .. BULLET 31 | -------------------------------------------------------------------------------- /liquid_tags/liquid_tags.py: -------------------------------------------------------------------------------- 1 | from pelican import signals 2 | from .mdx_liquid_tags import LiquidTags, LT_CONFIG 3 | 4 | 5 | def addLiquidTags(gen): 6 | if not gen.settings.get('MARKDOWN'): 7 | from pelican.settings import DEFAULT_CONFIG 8 | gen.settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN'] 9 | 10 | if LiquidTags not in gen.settings['MARKDOWN']: 11 | configs = dict() 12 | for key,value in LT_CONFIG.items(): 13 | configs[key]=value 14 | for key,value in gen.settings.items(): 15 | if key in LT_CONFIG: 16 | configs[key]=value 17 | gen.settings['MARKDOWN'].setdefault( 18 | 'extensions', [] 19 | ).append( 20 | LiquidTags(configs) 21 | ) 22 | 23 | 24 | def register(): 25 | signals.initialized.connect(addLiquidTags) 26 | -------------------------------------------------------------------------------- /bootstrap-rst/page.tmpl: -------------------------------------------------------------------------------- 1 | %(head_prefix)s 2 | %(head)s 3 | 4 | 5 | 6 | 7 | 8 | %(stylesheet)s 9 | %(body_prefix)s 10 | %(body_pre_docinfo)s 11 | %(docinfo)s 12 |
13 | %(body)s 14 |
15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | %(body_suffix)s 23 | -------------------------------------------------------------------------------- /liquid_tags/test_data/pelicanconf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- # 3 | from __future__ import unicode_literals 4 | 5 | AUTHOR = 'The Tester' 6 | SITENAME = 'Testing site' 7 | SITEURL = 'http://example.com/test' 8 | 9 | # to make the test suite portable 10 | TIMEZONE = 'UTC' 11 | PATH = 'content' 12 | 13 | READERS = {'html': None} 14 | 15 | # Generate only one feed 16 | FEED_ALL_ATOM = None 17 | CATEGORY_FEED_ATOM = None 18 | TRANSLATION_FEED_ATOM = None 19 | AUTHOR_FEED_ATOM = None 20 | AUTHOR_FEED_RSS = None 21 | 22 | # Disable unnecessary pages 23 | CATEGORY_SAVE_AS = '' 24 | TAG_SAVE_AS = '' 25 | AUTHOR_SAVE_AS = '' 26 | ARCHIVES_SAVE_AS = '' 27 | AUTHORS_SAVE_AS = '' 28 | CATEGORIES_SAVE_AS = '' 29 | TAGS_SAVE_AS = '' 30 | 31 | PLUGIN_PATHS = ['../../'] 32 | PLUGINS = ['liquid_tags.notebook'] 33 | 34 | NOTEBOOK_DIR = 'notebooks' 35 | -------------------------------------------------------------------------------- /simple_footnotes/README.md: -------------------------------------------------------------------------------- 1 | Simple Footnotes 2 | ================ 3 | 4 | A Pelican plugin to add footnotes to blog posts. 5 | 6 | When writing a post or page, add a footnote like this: 7 | 8 | Here's my written text[ref]and here is a footnote[/ref]. 9 | 10 | This will appear as, roughly: 11 | 12 | Here's my written text1 13 | 14 | 1. and here is a footnote ↩ 15 | 16 | Inspired by Andrew Nacin's [Simple Footnotes WordPress plugin](http://wordpress.org/plugins/simple-footnotes/). 17 | 18 | Requirements 19 | ============ 20 | 21 | Needs html5lib, so you'll want to `pip install html5lib` before running. 22 | 23 | Should work with any content format (ReST, Markdown, whatever), because 24 | it looks for the `[ref]` and `[/ref]` once the conversion to HTML has happened. 25 | 26 | Stuart Langridge, http://www.kryogenix.org/, February 2014. 27 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-breadcrumbs.txt: -------------------------------------------------------------------------------- 1 | Breadcrumbs 2 | =============================================================================== 3 | .. lead:: Indicate the current page's location within a navigational hierarchy. 4 | 5 | 6 | Separators are automatically added in CSS through `:before` and `content.` 7 | 8 | 9 | .. container:: bs-example 10 | 11 | .. class:: breadcrumb 12 | 13 | * Home 14 | 15 | .. class:: breadcrumb 16 | 17 | * Home 18 | * Library 19 | 20 | .. class:: breadcrumb 21 | 22 | * Home 23 | * Library 24 | * Data 25 | 26 | 27 | .. code:: 28 | :class: highlight 29 | 30 | .. class:: breadcrumb 31 | 32 | * Home 33 | 34 | .. class:: breadcrumb 35 | 36 | * Home 37 | * Library 38 | 39 | .. class:: breadcrumb 40 | 41 | * Home 42 | * Library 43 | * Data 44 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/css/wide.css: -------------------------------------------------------------------------------- 1 | @import url("main.css"); 2 | 3 | body { 4 | font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif; 5 | } 6 | 7 | .post-info{ 8 | display: none; 9 | } 10 | 11 | #banner nav { 12 | display: none; 13 | -moz-border-radius: 0px; 14 | margin-bottom: 20px; 15 | overflow: hidden; 16 | font-size: 1em; 17 | background: #F5F4EF; 18 | } 19 | 20 | #banner nav ul{ 21 | padding-right: 50px; 22 | } 23 | 24 | #banner nav li{ 25 | float: right; 26 | color: #000; 27 | } 28 | 29 | #banner nav li a { 30 | color: #000; 31 | } 32 | 33 | #banner h1 { 34 | margin-bottom: -18px; 35 | } 36 | 37 | #featured, #extras { 38 | padding: 50px; 39 | } 40 | 41 | #featured { 42 | padding-top: 20px; 43 | } 44 | 45 | #extras { 46 | padding-top: 0px; 47 | padding-bottom: 0px; 48 | } 49 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/localized_theme/translations/de/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # German translations for PROJECT. 2 | # Copyright (C) 2014 ORGANIZATION 3 | # This file is distributed under the same license as the PROJECT project. 4 | # FIRST AUTHOR , 2014. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: PROJECT VERSION\n" 9 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 10 | "POT-Creation-Date: 2014-07-13 12:25+0200\n" 11 | "PO-Revision-Date: 2014-07-13 12:26+0200\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: de \n" 14 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 1.3\n" 19 | 20 | #: templates/base.html:3 21 | msgid "Welcome to our" 22 | msgstr "Willkommen Sie zur unserer" 23 | 24 | -------------------------------------------------------------------------------- /test_data/content/super_article.rst: -------------------------------------------------------------------------------- 1 | This is a super article ! 2 | ######################### 3 | 4 | :tags: foo, bar, foobar 5 | :date: 2010-12-02 10:14 6 | :category: yeah 7 | :author: Alexis Métaireau 8 | :summary: 9 | Multi-line metadata should be supported 10 | as well as **inline markup**. 11 | 12 | Some content here ! 13 | 14 | This is a simple title 15 | ====================== 16 | 17 | And here comes the cool stuff_. 18 | 19 | .. image:: |filename|/pictures/Sushi.jpg 20 | :height: 450 px 21 | :width: 600 px 22 | :alt: alternate text 23 | 24 | .. image:: |filename|/pictures/Sushi_Macro.jpg 25 | :height: 450 px 26 | :width: 600 px 27 | :alt: alternate text 28 | 29 | :: 30 | 31 | >>> from ipdb import set_trace 32 | >>> set_trace() 33 | 34 | → And now try with some utf8 hell: ééé 35 | 36 | .. _stuff: http://books.couchdb.org/relax/design-documents/views 37 | -------------------------------------------------------------------------------- /dateish/dateish.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Dateish Plugin for Pelican 4 | ========================== 5 | 6 | This plugin adds the ability to treat arbitrary metadata fields as datetime 7 | objects. 8 | """ 9 | 10 | from pelican import signals 11 | from pelican.utils import get_date 12 | 13 | 14 | def dateish(generator): 15 | if 'DATEISH_PROPERTIES' not in generator.settings: 16 | return 17 | 18 | for article in generator.articles: 19 | for field in generator.settings['DATEISH_PROPERTIES']: 20 | if hasattr(article, field): 21 | value = getattr(article, field) 22 | if type(value) == list: 23 | setattr(article, field, [get_date(d) for d in value]) 24 | else: 25 | setattr(article, field, get_date(value)) 26 | 27 | def register(): 28 | signals.article_generator_finalized.connect(dateish) 29 | -------------------------------------------------------------------------------- /events/events_list.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base.html" %} 3 | 4 | {% block title %} Events list - {{ SITENAME }}{% endblock %} 5 | 6 | {% block content %} 7 | 8 | {% if events_list %} 9 |
    10 | {% for evstart, evend, event in events_list %} 11 |
  • 12 |

    13 | 14 | {{event['title']}} 15 | 16 |

    17 |

    18 | {% if evstart.date() == evend.date() %} 19 | From {{evstart}} to {{evend.time()}} 20 | {% else %} 21 | From {{evstart}} to {{evend}} 22 | {% endif %} 23 |

    24 | 25 | {% if event.location %} 26 |

    Location: {{event.location}}

    27 | {% endif %} 28 | 29 |

    {{event['summary']}}

    30 | 31 |
  • 32 | {% endfor %} 33 |
34 | {% endif %} 35 | 36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /pelican_comment_system/doc/feed.md: -------------------------------------------------------------------------------- 1 | # Comment Atom Feed 2 | ## Custom comment url 3 | Be sure that the id of the html tag containing the comment matches `COMMENT_URL`. 4 | 5 | ##### pelicanconf.py 6 | ```python 7 | COMMENT_URL = "#my_own_comment_id_{slug}" 8 | ``` 9 | 10 | ##### Theme 11 | ```html 12 | {% for comment in article.comments recursive %} 13 | ... 14 |
{{ comment.content }}
15 | ... 16 | {% endfor %} 17 | ``` 18 | ## Theme 19 | #### Link 20 | To display a link to the article feed simply add the following to your theme: 21 | 22 | ```html 23 | {% if article %} 24 | Comment Atom Feed 25 | {% endif %} 26 | ``` 27 | 28 | Link to the all comment feed: 29 | 30 | ```html 31 | Comment All Atom Feed 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /googleplus_comments/googleplus_comments.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Google Comments Plugin For Pelican 4 | ================================== 5 | 6 | Adds Google comments to Pelican 7 | """ 8 | 9 | from pelican import signals 10 | 11 | googleplus_comments_snippet = """ 12 | 13 | 23 | """ 24 | 25 | def add_googleplus_comments(generator, metadata): 26 | metadata["googleplus_comments"] = googleplus_comments_snippet 27 | 28 | def register(): 29 | signals.article_generator_context.connect(add_googleplus_comments) 30 | -------------------------------------------------------------------------------- /members/Readme.rst: -------------------------------------------------------------------------------- 1 | Members 2 | ------- 3 | 4 | This plugin looks for a ``members`` metadata header containing key/value pairs 5 | and makes them available for use in templates. 6 | 7 | The first line of this metadata defines each key, and the following line should 8 | contain corresponding values for each member. 9 | 10 | The keys must be in the same first line as the ``members`` metadata header, 11 | and the next line containing the corresponding values must have an identation 12 | before it. 13 | 14 | Example for reStructuredText:: 15 | 16 | :members: name, email, twitter, github, site_nome, site_href 17 | Danilo Shiga, daniloshiga@gmail.com, @daneoshiga, daneoshiga, Danilo Shiga, http://daniloshiga.com 18 | 19 | Example for Markdown:: 20 | 21 | members: name, email, twitter, github, site_nome, site_href 22 | Danilo Shiga, daniloshiga@gmail.com, @daneoshiga, daneoshiga, Danilo Shiga, http://daniloshiga.com 23 | -------------------------------------------------------------------------------- /optimize_images/Readme.md: -------------------------------------------------------------------------------- 1 | Optimize Images Plugin For Pelican 2 | ================================== 3 | 4 | This plugin applies lossless compression on JPEG and PNG images, with no 5 | effect on image quality. It uses [jpegtran][1] and [OptiPNG][2]. It assumes 6 | that both of these tools are installed on system path. 7 | 8 | [1]: http://jpegclub.org/jpegtran/ "jpegtran" 9 | [2]: http://optipng.sourceforge.net/ "OptiPNG" 10 | 11 | 12 | Installation 13 | ------------ 14 | 15 | To enable, ensure that `optimize_images.py` is put somewhere that is accessible. 16 | Then use as follows by adding the following to your settings.py: 17 | 18 | PLUGIN_PATH = 'path/to/pelican-plugins' 19 | PLUGINS = ["optimize_images"] 20 | 21 | `PLUGIN_PATH` can be a path relative to your settings file or an absolute path. 22 | 23 | Usage 24 | ----- 25 | The plugin will activate and optimize images upon `finalized` signal of 26 | pelican. -------------------------------------------------------------------------------- /footer_insert/footer_insert.py: -------------------------------------------------------------------------------- 1 | """ 2 | Footer Insert 3 | """ 4 | 5 | from pelican import signals 6 | from pelican.contents import Content, Article 7 | 8 | 9 | def add_footer(content): 10 | if not isinstance(content, Article): 11 | return 12 | 13 | if 'FOOTER_INSERT_HTML' not in content.settings: 14 | return 15 | data_dict = { 16 | 'title': content.title, 17 | 'url': content.url, 18 | 'author': content.author.name, 19 | 'authors': ','.join([x.name for x in content.authors]), 20 | 'slug': content.slug, 21 | 'category': content.category, 22 | 'summary': content.summary, 23 | } 24 | if hasattr(content, 'date'): 25 | data_dict['date'] = content.date 26 | foot_insert_html = content.settings['FOOTER_INSERT_HTML'] % data_dict 27 | content.footer_insert_html = foot_insert_html 28 | 29 | def register(): 30 | signals.content_object_init.connect(add_footer) 31 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/piwik.html: -------------------------------------------------------------------------------- 1 | {% if PIWIK_URL and PIWIK_SITE_ID %} 2 | 16 | {% endif %} -------------------------------------------------------------------------------- /gravatar/gravatar.py: -------------------------------------------------------------------------------- 1 | """ 2 | Gravatar plugin for Pelican 3 | =========================== 4 | 5 | This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and 6 | makes the variable available within the article's context. 7 | """ 8 | 9 | import hashlib 10 | import six 11 | 12 | from pelican import signals 13 | 14 | 15 | def add_gravatar(generator, metadata): 16 | 17 | #first check email 18 | if 'email' not in metadata.keys()\ 19 | and 'AUTHOR_EMAIL' in generator.settings.keys(): 20 | metadata['email'] = generator.settings['AUTHOR_EMAIL'] 21 | 22 | #then add gravatar url 23 | if 'email' in metadata.keys(): 24 | email_bytes = six.b(metadata['email']).lower() 25 | gravatar_url = "https://www.gravatar.com/avatar/" + \ 26 | hashlib.md5(email_bytes).hexdigest() 27 | metadata['author_gravatar'] = gravatar_url 28 | 29 | 30 | def register(): 31 | signals.article_generator_context.connect(add_gravatar) 32 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/article.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 |
5 |

6 | {{ article.title }}

8 | {% import 'translations.html' as translations with context %} 9 | {{ translations.translations_for(article) }} 10 |
11 |
12 | 13 | {{ article.locale_date }} 14 | 15 | {% if article.author %} 16 |
17 | By {{ article.author }} 18 |
19 | {% endif %} 20 |
21 |
22 | {{ article.content }} 23 |
24 |
25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /static_comments/Readme.md: -------------------------------------------------------------------------------- 1 | Static comments 2 | --------------- 3 | 4 | This plugin allows you to add static comments to an article. By default the 5 | plugin looks for the comments of each article in a local file named 6 | ``comments/{slug}.md``, where ``{slug}`` is the value of the slug tag for the 7 | article. The comments file should be formatted using markdown. 8 | 9 | Set the ``STATIC_COMMENTS`` parameter to True to enable the plugin. Default is 10 | False. 11 | 12 | Set the ``STATIC_COMMENTS_DIR`` parameter to the directory where the comments 13 | are located. Default is ``comments``. 14 | 15 | On the template side, you just have to add a section for the comments to your 16 | ``article.html``, as in this example:: 17 | 18 | {% if STATIC_COMMENTS %} 19 |
20 |

Comments!

21 | {{ article.metadata.static_comments }} 22 |
23 | {% endif %} 24 | 25 | Here is an example of usage: 26 | 27 | -------------------------------------------------------------------------------- /multi_part/Readme.md: -------------------------------------------------------------------------------- 1 | Multi parts posts 2 | ----------------- 3 | 4 | **This plugin has been deprecated. See the series plugin for a better support of multi part articles.** 5 | 6 | The multi-part posts plugin allow you to write multi-part posts. 7 | 8 | In order to mark posts as part of a multi-part post, use the `:parts:` metadata: 9 | 10 | :parts: MY_AWESOME_MULTI_PART_POST 11 | 12 | You can then use the `article.metadata.parts_articles` variable in your templates 13 | to display other parts of current post. 14 | 15 | For example: 16 | 17 | {% if article.metadata.parts_articles %} 18 |

This post is part of a series:

19 |
    20 | {% for part_article in article.metadata.parts_articles %} 21 |
  1. 22 | {{ part_article.title }} 23 |
  2. 24 | {% endfor %} 25 |
26 | {% endif %} 27 | -------------------------------------------------------------------------------- /filetime_from_git/utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Utility functions 4 | """ 5 | from datetime import datetime 6 | import logging 7 | from pelican.utils import set_date_tzinfo 8 | 9 | DEV_LOGGER = logging.getLogger(__name__) 10 | 11 | 12 | STRING_BOOLS = { 13 | 'yes': True, 14 | 'no': False, 15 | 'true': True, 16 | 'false': False, 17 | '0': False, 18 | '1': True, 19 | 'on': True, 20 | 'off': False, 21 | } 22 | 23 | 24 | def string_to_bool(string): 25 | ''' 26 | Convert a string to a bool based 27 | ''' 28 | return STRING_BOOLS[string.strip().lower()] 29 | 30 | 31 | def datetime_from_timestamp(timestamp, content): 32 | """ 33 | Helper function to add timezone information to datetime, 34 | so that datetime is comparable to other datetime objects in recent versions 35 | that now also have timezone information. 36 | """ 37 | return set_date_tzinfo( 38 | datetime.fromtimestamp(timestamp), 39 | tz_name=content.settings.get('TIMEZONE', None)) 40 | -------------------------------------------------------------------------------- /touch/__init__.py: -------------------------------------------------------------------------------- 1 | from pelican import signals 2 | 3 | import logging 4 | import os 5 | import time 6 | 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | def set_file_utime(path, datetime): 12 | mtime = time.mktime(datetime.timetuple()) 13 | logger.info('touching %s', path) 14 | os.utime(path, (mtime, mtime)) 15 | 16 | 17 | def touch_file(path, context): 18 | content = context.get('article', context.get('page')) 19 | page = context.get('articles_page') 20 | dates = context.get('dates') 21 | 22 | if content and hasattr(content, 'date'): 23 | set_file_utime(path, content.date) 24 | elif page: 25 | set_file_utime(path, max(x.date for x in page.object_list)) 26 | elif dates: 27 | set_file_utime(path, max(x.date for x in dates)) 28 | 29 | 30 | def touch_feed(path, context, feed): 31 | set_file_utime(path, max(x['pubdate'] for x in feed.items)) 32 | 33 | 34 | def register(): 35 | signals.content_written.connect(touch_file) 36 | signals.feed_written.connect(touch_feed) 37 | -------------------------------------------------------------------------------- /category_meta/README.md: -------------------------------------------------------------------------------- 1 | Category Metadata 2 | ----------------- 3 | 4 | A plugin to read metadata for each category from an index file in that 5 | category's directory. 6 | 7 | For this plugin to work properly, your articles should not have a 8 | Category: tag in their metadata; instead, they should be stored in 9 | (subdirectories of) per-category directories. Each per-category 10 | directory must have a file named 'index.ext' at its top level, where 11 | .ext is any extension that will be picked up by an article reader. 12 | The metadata of that article becomes the metadata for the category, 13 | copied over verbatim, with three special cases: 14 | 15 | * The category's name is set to the article's title. 16 | * The category's slug is set to the name of the parent directory 17 | of the index.ext file. 18 | * The _text_ of the article is stored as category.description. 19 | 20 | You can use this, for example, to control the slug used for each 21 | category independently of its name, or to add a description at the top 22 | of each category page. 23 | -------------------------------------------------------------------------------- /permalinks/README.md: -------------------------------------------------------------------------------- 1 | permalink 2 | ========= 3 | 4 | This plugin enables a kind of permalink which can be used to refer to a piece 5 | of content which is resistant to the file being moved or renamed. 6 | 7 | It does this by creating additional output html in `PERMALINK_PATH` 8 | (default permalinks/) which include redirect code to point user at original 9 | page. 10 | 11 | To work each page has to have an additional piece of metadata with the key 12 | `permalink_id` (configurable with `PERMALINK_ID_METADATA_KEY` 13 | which should remain static even through renames and should also 14 | be unique on the site. 15 | 16 | This can be generated automatically with the filetime_from_git module and 17 | the `GIT_FILETIME_GENERATE_PERMALINK` option. 18 | This should always be used with `GIT_FILETIME_FOLLOW` to ensure this 19 | persists across renames. 20 | 21 | 22 | Hacky redirects 23 | --------------- 24 | To make this work with things like github.io I'm forced to use HTML and 25 | Javascript redirects rather than HTTP redirects which is obviously suboptimal. 26 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-wells.txt: -------------------------------------------------------------------------------- 1 | Wells 2 | =============================================================================== 3 | 4 | Default well 5 | ------------ 6 | 7 | Use the well as a simple effect on an element to give it an inset effect. 8 | 9 | .. container:: bs-example 10 | 11 | .. class:: well 12 | 13 | Look, I'm in a well! 14 | 15 | .. code:: 16 | :class: highlight 17 | 18 | .. class:: well 19 | 20 | Look, I'm in a well! 21 | 22 | 23 | Optional classes 24 | ---------------- 25 | 26 | Control padding and rounded corners with two optional modifier classes. 27 | 28 | .. container:: bs-example 29 | 30 | .. class:: well well-lg 31 | 32 | Look, I'm in a well! 33 | 34 | .. code:: 35 | :class: highlight 36 | 37 | .. class:: well well-lg 38 | 39 | Look, I'm in a well! 40 | 41 | 42 | .. container:: bs-example 43 | 44 | .. class:: well well-sm 45 | 46 | Look, I'm in a well! 47 | 48 | .. code:: 49 | :class: highlight 50 | 51 | .. class:: well well-sm 52 | 53 | Look, I'm in a well! 54 | -------------------------------------------------------------------------------- /bootstrap-rst/Makefile: -------------------------------------------------------------------------------- 1 | MAKE = /usr/bin/make 2 | RST2HTML = ./bootstrap.py 3 | STYLESHEET = 4 | RST2HTML_OPTIONS = --strip-comments \ 5 | --report=3 \ 6 | --no-doc-title \ 7 | --traceback \ 8 | --compact-lists \ 9 | --no-toc-backlinks \ 10 | --syntax-highlight=short \ 11 | --template=page.tmpl \ 12 | --cloak-email-addresses \ 13 | --stylesheet=$(STYLESHEET) \ 14 | --link-stylesheet 15 | 16 | SOURCES = $(wildcard doc/*.rst) 17 | TMP = $(subst .rst,.html, $(SOURCES)) 18 | OBJECTS = $(subst doc/,, $(TMP)) 19 | 20 | all:$(OBJECTS) 21 | 22 | %.html: doc/%.rst 23 | @echo " - $@" 24 | @$(RST2HTML) $(RST2HTML_OPTIONS) $< $@ 25 | 26 | clean: 27 | @-rm -f $(OBJECTS) 28 | 29 | distclean: clean 30 | @-rm -f `find . -name "*~"` 31 | 32 | .PHONY: all clean distclean 33 | -------------------------------------------------------------------------------- /filetime_from_git/registration.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Handle registration and setup for plugin 4 | """ 5 | import logging 6 | from blinker import signal 7 | from .content_adapter import GitContentAdapter 8 | from pelican import signals 9 | 10 | DEV_LOGGER = logging.getLogger(__name__) 11 | 12 | content_git_object_init = signal('content_git_object_init') 13 | 14 | def send_content_git_object_init(content): 15 | content_git_object_init.send(content, git_content=GitContentAdapter(content)) 16 | 17 | 18 | def setup_option_defaults(pelican_inst): 19 | pelican_inst.settings.setdefault('GIT_FILETIME_FROM_GIT', True) 20 | pelican_inst.settings.setdefault('GIT_HISTORY_FOLLOWS_RENAME', True) 21 | pelican_inst.settings.setdefault('GIT_SHA_METADATA', True) 22 | pelican_inst.settings.setdefault('GIT_GENERATE_PERMALINK', False) 23 | 24 | 25 | def register(): 26 | signals.content_object_init.connect(send_content_git_object_init) 27 | signals.initialized.connect(setup_option_defaults) 28 | 29 | # Import actions 30 | from . import actions 31 | -------------------------------------------------------------------------------- /liquid_tags/test_soundcloud.py: -------------------------------------------------------------------------------- 1 | from . import soundcloud 2 | import pytest 3 | 4 | 5 | @pytest.mark.parametrize('input,expected', [ 6 | ('https://soundcloud.com/forss/in-paradisum', 7 | dict(track_url='https://soundcloud.com/forss/in-paradisum')), 8 | ('http://soundcloud.com/forss/in-paradisum', 9 | dict(track_url='http://soundcloud.com/forss/in-paradisum')), 10 | ('https://soundcloud.com/toroymoi/real-love-ft-kool-ad', 11 | dict(track_url='https://soundcloud.com/toroymoi/real-love-ft-kool-ad')), 12 | ('https://soundcloud.com/capturedtracks/sets/wild-nothing-nocturne', 13 | dict(track_url=('https://soundcloud.com/capturedtracks/' 14 | 'sets/wild-nothing-nocturne'))) 15 | ]) 16 | def test_match_it(input, expected): 17 | assert soundcloud.match_it(input) == expected 18 | 19 | 20 | @pytest.mark.parametrize('input', [ 21 | 'http://foobar.com', 22 | 'foobar', 23 | 'https://google.com' 24 | ]) 25 | def test_match_it_exception(input): 26 | with pytest.raises(ValueError): 27 | soundcloud.match_it(input) 28 | -------------------------------------------------------------------------------- /liquid_tags/speakerdeck.py: -------------------------------------------------------------------------------- 1 | """ 2 | Speakerdeck Tag 3 | --------------- 4 | This implements a Liquid-style speakerdeck tag for Pelican. 5 | 6 | Syntax 7 | ------ 8 | {% speakerdeck id %} 9 | 10 | Example 11 | ------- 12 | {% speakerdeck 82b209c0f181013106da6eb14261a8ef %} 13 | 14 | Output 15 | ------ 16 | 18 | """ 19 | from .mdx_liquid_tags import LiquidTags 20 | 21 | SYNTAX = "{% speakerdeck id %}" 22 | 23 | @LiquidTags.register('speakerdeck') 24 | def speakerdeck(preprocessor, tag, markup): 25 | speakerdeck_out = """ 26 | 28 | """.format(id=markup) 29 | 30 | return speakerdeck_out 31 | 32 | 33 | # --------------------------------------------------- 34 | # This import allows speakerdeck tag to be a Pelican plugin 35 | from liquid_tags import register # noqa 36 | -------------------------------------------------------------------------------- /creole_reader/Readme.md: -------------------------------------------------------------------------------- 1 | # Creole Reader 2 | 3 | This plugins allows you to write your posts using the wikicreole syntax. Give to 4 | these files the creole extension. The metadata are between `<
> <
>` 5 | tags. 6 | 7 | ## Dependency 8 | This plugin relies on [python-creole](https://pypi.python.org/pypi/python-creole/) to work. Install it with: 9 | `pip install python-creole` 10 | 11 | ## Syntax 12 | Use ** for strong, // for emphasis, one = for 1st level titles. Please use the 13 | following macro for code highlighting: 14 | `<> <>` 15 | 16 | For the complete syntax, look at: http://www.wikicreole.org/ 17 | 18 | ## Basic example 19 | ``` 20 | <
> 21 | title: Créole 22 | tags: creole, python, pelican_open 23 | date: 2013-12-12 24 | <
> 25 | 26 | = Title 1 27 | == Title 2 28 | 29 | Some nice text with **strong** and //emphasis//. 30 | 31 | * A nice list 32 | ** With sub-elements 33 | * Python 34 | 35 | <> 36 | print("Hello World") 37 | <> 38 | 39 | # An ordered list 40 | # A second item 41 | ``` 42 | -------------------------------------------------------------------------------- /section_number/Readme.md: -------------------------------------------------------------------------------- 1 | Section Number 2 | -------------- 3 | 4 | This plugin adds section numbers to an article's context, in the form of `X.X.X`. Sections are indicated via Markdown headers, which appear as `

` in the generated HTML. 5 | 6 | 7 | # Settings 8 | 9 | By default, up to three section levels will be prefixed with numbers. You can customize this value by defining `SECTION_NUMBER_MAX` in your settings file: 10 | 11 | SECTION_NUMBER_MAX = 5 12 | 13 | 14 | # Caveat 15 | 16 | The first section in the article will be marked as the top section level. Namely, if `

` is the first section encountered, the plugin assumes that no `

` or `

` sections will be present. Otherwise an exception may result. 17 | 18 | 19 | # Example 20 | 21 | The following Markdown content... 22 | 23 | # section 24 | blabla 25 | ## subsection 26 | blabla 27 | ## subsection 28 | blabla 29 | # section 30 | blabla 31 | 32 | ... will be rendered as: 33 | 34 | >#1 section 35 | >blabla 36 | >##1.1 subsection 37 | >blabla 38 | >##1.2 subsection 39 | >blabla 40 | >#2 section 41 | >blabla 42 | -------------------------------------------------------------------------------- /better_tables/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Alex Waite 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | SOFTWARE. 19 | -------------------------------------------------------------------------------- /pelican_unity_webgl/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Mr.Page 2 | Permission is hereby granted, free of charge, to any person obtaininga copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | SOFTWARE. -------------------------------------------------------------------------------- /html_rst_directive/Readme.rst: -------------------------------------------------------------------------------- 1 | HTML tags for reStructuredText 2 | ------------------------------ 3 | 4 | This plugin allows you to use HTML tags from within reST documents. 5 | 6 | 7 | Directives 8 | ---------- 9 | 10 | 11 | :: 12 | 13 | .. html:: 14 | 15 | (HTML code) 16 | 17 | 18 | Example 19 | ------- 20 | 21 | A search engine:: 22 | 23 | .. html:: 24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 | 32 | A contact form:: 33 | 34 | .. html:: 35 | 36 |
37 |

38 | 39 |
40 | 42 |
43 | 44 |

45 |
46 | -------------------------------------------------------------------------------- /liquid_tags/test_giphy.py: -------------------------------------------------------------------------------- 1 | from . import giphy 2 | try: 3 | from unittest.mock import patch 4 | except ImportError: 5 | from mock import patch 6 | import os 7 | import pytest 8 | 9 | 10 | PLUGIN_DIR = os.path.dirname(__file__) 11 | TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data') 12 | 13 | 14 | @pytest.mark.parametrize('input,expected', [ 15 | (dict(gif_id='abc123'), 16 | ('' 17 | 'source: http://www.tumblr.com')), 19 | (dict(gif_id='abc123', alt='ive had some free time'), 20 | ('' 21 | 'ive had some free time')) 23 | ]) 24 | @patch('liquid_tags.giphy.urlopen') 25 | def test_create_html(mock_urlopen, input, expected): 26 | with open(TEST_DATA_DIR + '/giphy.json', 'rb') as f: 27 | mock_urlopen.return_value.read.return_value = f.read() 28 | 29 | assert giphy.create_html('test_api_key', input) == expected 30 | -------------------------------------------------------------------------------- /txt2tags_reader/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /yuicompressor/yuicompressor.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from pelican import signals 4 | from subprocess import call 5 | import logging 6 | import os 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | # Display command output on DEBUG and TRACE 11 | SHOW_OUTPUT = logger.getEffectiveLevel() <= logging.DEBUG 12 | 13 | """ 14 | Minify CSS and JS files in output path 15 | with Yuicompressor from Yahoo 16 | Required : pip install yuicompressor 17 | """ 18 | 19 | def minify(pelican): 20 | """ 21 | Minify CSS and JS with YUI Compressor 22 | :param pelican: The Pelican instance 23 | """ 24 | for dirpath, _, filenames in os.walk(pelican.settings['OUTPUT_PATH']): 25 | for name in filenames: 26 | if os.path.splitext(name)[1] in ('.css','.js'): 27 | filepath = os.path.join(dirpath, name) 28 | logger.info('minifiy %s', filepath) 29 | verbose = '-v' if SHOW_OUTPUT else '' 30 | call("yuicompressor {} --charset utf-8 {} -o {}".format( 31 | verbose, filepath, filepath), shell=True) 32 | 33 | def register(): 34 | signals.finalized.connect(minify) 35 | -------------------------------------------------------------------------------- /bootstrap-rst/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Nicolas P. Rougier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /multi_part/multi_part.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Copyright (c) FELD Boris 4 | 5 | Multiple part support 6 | ===================== 7 | 8 | Create a navigation menu for multi-part related_posts 9 | """ 10 | 11 | from collections import defaultdict 12 | 13 | from pelican import signals 14 | 15 | from logging import warning 16 | 17 | warning_message = """multi_part plugin: this plugin has been deprecated. 18 | The 'series' plugin provides better support for multi part articles. 19 | """ 20 | 21 | def aggregate_multi_part(generator): 22 | warning(warning_message) 23 | multi_part = defaultdict(list) 24 | 25 | for article in generator.articles: 26 | if 'parts' in article.metadata: 27 | multi_part[article.metadata['parts']].append(article) 28 | 29 | for part_id in multi_part: 30 | parts = multi_part[part_id] 31 | 32 | # Sort by date 33 | parts.sort(key=lambda x: x.metadata['date']) 34 | 35 | for article in parts: 36 | article.metadata['parts_articles'] = parts 37 | 38 | 39 | def register(): 40 | signals.article_generator_finalized.connect(aggregate_multi_part) 41 | -------------------------------------------------------------------------------- /test_data/themes/simple/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
4 | {% block content_title %} 5 |

All articles

6 | {% endblock %} 7 | 8 |
    9 | {% for article in articles_page.object_list %} 10 |
  1. 18 | {% endfor %} 19 |
20 | {% include 'pagination.html' %} 21 |
22 | {% endblock content %} 23 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-jumbotron.txt: -------------------------------------------------------------------------------- 1 | Jumbotron 2 | =============================================================================== 3 | 4 | A lightweight, flexible component that can optionally extend the entire 5 | viewport to showcase key content on your site. 6 | 7 | .. container:: bs-example 8 | 9 | .. jumbotron:: 10 | 11 | :h1:`Hello, world!` 12 | 13 | This is a simple hero unit, a simple jumbotron-style component for 14 | calling extra attention to featured content or information. 15 | 16 | .. button:: Learn more 17 | :class: primary large 18 | 19 | .. code:: 20 | :class: highlight 21 | 22 | 23 | .. jumbotron:: 24 | 25 | :h1:`Hello, world!` 26 | 27 | This is a simple hero unit, a simple jumbotron-style component for 28 | calling extra attention to featured content or information. 29 | 30 | .. button:: Learn more 31 | :class: primary large 32 | 33 | 34 | To make the jumbotron full width, and without rounded corners, place it outside 35 | all .containers and instead add a .container within. 36 | 37 | .. code:: 38 | :class: highlight 39 | 40 | 41 | .. jumbotron:: 42 | 43 | .. container:: 44 | 45 | ... 46 | -------------------------------------------------------------------------------- /ical/Readme.rst: -------------------------------------------------------------------------------- 1 | ical 2 | ---- 3 | 4 | This plugin looks for and parses an ``.ics`` file if it is defined in a given 5 | page's ``calendar`` metadata. One calendar can be defined per page. 6 | 7 | Dependencies 8 | ------------ 9 | 10 | This plugin depends on the ``icalendar`` package, which can be installed via 11 | pip:: 12 | 13 | pip install icalendar 14 | 15 | Usage 16 | ----- 17 | 18 | For a reST-formatted page, include the following line in the metadata:: 19 | 20 | :calendar: /path/to/your/ics/file 21 | 22 | For Markdown, include the following line in the page metadata:: 23 | 24 | Calendar: /path/to/your/ics/file 25 | 26 | Following is some example code that can be added to your theme's ``page.html`` 27 | template in order to display the calendar:: 28 | 29 | {% if page.calendar %} 30 |
31 | {% for vevent in events[page.slug] %} 32 |
{{ vevent.summary }}
33 |
{{ vevent.description|replace('\n\n', '
') }}
34 |
{{ vevent.dtstart }}
35 |
{{ vevent.dtend }}
36 | 37 | {% endfor %} 38 |
39 | {% endif %} 40 | -------------------------------------------------------------------------------- /headerid/headerid.py: -------------------------------------------------------------------------------- 1 | from pelican import readers 2 | from pelican.readers import PelicanHTMLTranslator 3 | from pelican import signals 4 | from docutils import nodes 5 | 6 | LINK_CHAR = '*' 7 | 8 | 9 | def init_headerid(sender): 10 | global LINK_CHAR 11 | char = sender.settings.get('HEADERID_LINK_CHAR') 12 | if char: 13 | LINK_CHAR = char 14 | 15 | def register(): 16 | signals.initialized.connect(init_headerid) 17 | 18 | 19 | class HeaderIDPatchedPelicanHTMLTranslator(PelicanHTMLTranslator): 20 | def depart_title(self, node): 21 | close_tag = self.context[-1] 22 | parent = node.parent 23 | if isinstance(parent, nodes.section) and parent.hasattr('ids') and parent['ids']: 24 | anchor_name = parent['ids'][0] 25 | # add permalink anchor 26 | if close_tag.startswith('%s' % 29 | (anchor_name, LINK_CHAR)) 30 | PelicanHTMLTranslator.depart_title(self, node) 31 | readers.PelicanHTMLTranslator = HeaderIDPatchedPelicanHTMLTranslator 32 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/de/pages/untranslated-page-en.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Untranslated page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 17 |

Untranslated page

18 | 19 | 20 |

This page has no translation.

21 | 22 | 23 |
24 |
25 | Proudly powered by Pelican, 26 | which takes great advantage of Python. 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/CSS-code.txt: -------------------------------------------------------------------------------- 1 | Code 2 | =============================================================================== 3 | 4 | Inline 5 | ------ 6 | 7 | Wrap inline snippets of code with `:code:`. 8 | 9 | .. container:: bs-example 10 | 11 | For example, `
` should be wrapped as inline. 12 | 13 | .. code:: 14 | :class: highlight 15 | 16 | For example, :code:`
` should be wrapped as inline. 17 | 18 | User input 19 | ---------- 20 | 21 | Use the `:kbd:` to indicate input that is typically entered via keyboard. 22 | 23 | .. container:: bs-example 24 | 25 | To switch directories, type :kbd:`cd` followed by the name of the directory. 26 | 27 | .. code:: 28 | :class: highlight 29 | 30 | To switch directories, type :kbd:`cd` followed by the name of the directory. 31 | 32 | Basic block 33 | ----------- 34 | 35 | Use `.. code::` for multiple lines of code. Be sure to escape any angle brackets in 36 | the code for proper rendering. 37 | 38 | .. container:: bs-example 39 | 40 | Sample text here... 41 | 42 | .. code:: 43 | :class: highlight 44 | 45 | Sample text here... 46 | 47 | You may optionally add the pre-scrollable class, which will set a max-height 48 | of 350px and provide a y-axis scrollbar. 49 | -------------------------------------------------------------------------------- /pdf/Readme.rst: -------------------------------------------------------------------------------- 1 | ------------- 2 | PDF Generator 3 | ------------- 4 | 5 | The PDF Generator plugin automatically exports articles and pages as PDF files 6 | as part of the site generation process. PDFs are saved to: 7 | ``output/pdf/`` 8 | 9 | Requirements 10 | ------------ 11 | 12 | You should ensure you have the ``rst2pdf`` module installed, which can be 13 | accomplished via:: 14 | 15 | pip install rst2pdf 16 | 17 | If you are converting Markdown sources to PDF, you also need the ``xhtml2pdf`` 18 | module, which can be installed with:: 19 | 20 | pip install xhtml2pdf 21 | 22 | Usage 23 | ----- 24 | 25 | To customize the PDF output, you can use the following settings in your 26 | Pelican configuration file:: 27 | 28 | PDF_STYLE = '' 29 | PDF_STYLE_PATH = '' 30 | 31 | ``PDF_STYLE_PATH`` defines a new path where ``rst2pdf`` will look for style 32 | sheets, while ``PDF_STYLE`` specifies the style you want to use. For a 33 | description of the available styles, please read the `rst2pdf documentation`_. 34 | 35 | .. _rst2pdf documentation: http://rst2pdf.ralsina.me/handbook.html#styles 36 | 37 | Known Issues 38 | ------------ 39 | 40 | Relative links in the form of ``|filename|images/test.png`` are not yet handled 41 | by the PDF generator. 42 | -------------------------------------------------------------------------------- /related_posts/Readme.rst: -------------------------------------------------------------------------------- 1 | Related posts 2 | ------------- 3 | 4 | This plugin adds the ``related_posts`` variable to the article's context. 5 | By default, up to 5 articles are listed. You can customize this value by 6 | defining ``RELATED_POSTS_MAX`` in your settings file:: 7 | 8 | RELATED_POSTS_MAX = 10 9 | 10 | You can then use the ``article.related_posts`` variable in your templates. 11 | For example:: 12 | 13 | {% if article.related_posts %} 14 | 19 | {% endif %} 20 | 21 | 22 | Your related posts should share a common tag. You can also use ``related_posts:`` in your post's meta data. 23 | The 'related_posts:' meta data works together with your existing slugs:: 24 | 25 | related_posts: slug1, slug2, slug3, ... slugN 26 | 27 | ``N`` represents the ``RELATED_POSTS_MAX``. 28 | 29 | Additionally, you can specify:: 30 | 31 | RELATED_POSTS_SKIP_SAME_CATEGORY = True 32 | 33 | in your settings file. With this setting, ``article.related_posts`` will 34 | contain only related posts from categories other than the original article's. 35 | -------------------------------------------------------------------------------- /twitter_bootstrap_rst_directives/Readme.rst: -------------------------------------------------------------------------------- 1 | Twitter Bootstrap Directive for restructured text 2 | ------------------------------------------------- 3 | 4 | This plugin defines some rst directive that enable a clean usage of the twitter bootstrap CSS and Javascript components. 5 | 6 | Directives 7 | ---------- 8 | 9 | Implemented directives: 10 | 11 | label, 12 | alert, 13 | panel, 14 | media 15 | 16 | Implemented roles: 17 | 18 | glyph, 19 | code, 20 | kbd 21 | 22 | Usage 23 | ----- 24 | 25 | For more informations about the usage of each directive, read the corresponding class description. 26 | Or checkout this demo page. 27 | 28 | Dependencies 29 | ------------ 30 | 31 | In order to use this plugin, you need to use a template that supports bootstrap 3.1.1 with the glyph font setup 32 | correctly. Usually you should have this structure:: 33 | 34 | static 35 | ├── css 36 | | └── bootstrap.min.css 37 | ├── font 38 | | └── glyphicons-halflings-regular.ttf 39 | └── js 40 | └── 41 | 42 | Warning 43 | ------- 44 | 45 | In order to support some unique features and avoid conflicts with bootstrap, this plugin will use a custom html writer which 46 | is modifying the traditional docutils output. -------------------------------------------------------------------------------- /clean_summary/README.md: -------------------------------------------------------------------------------- 1 | # Clean Summary Plugin 2 | 3 | This plugin cleans your summary of excess images. Images can take up much more 4 | space than text and lead to summaries being different sizes on archive and 5 | index pages. With this plugin, you can specify a maximum number of images that 6 | will appear in your summaries. 7 | 8 | There is also an option to include a minimum of one image. 9 | 10 | ## Settings 11 | 12 | This plugin has two settings: `CLEAN_SUMMARY_MAXIMUM`, which takes an integer, 13 | and `CLEAN_SUMMARY_MINIMUM_ONE`, which takes a Boolean value. They default to 14 | `0` and `False`, respectively. 15 | 16 | `CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in 17 | your summary. 18 | 19 | If `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already 20 | contain an image, the plugin will add the first image in your article (if one 21 | exists) to the beginning of the summary. 22 | 23 | ## Requirements 24 | 25 | Requires Beautiful Soup: 26 | 27 | pip install BeautifulSoup4 28 | 29 | ## Usage with Summary Plugin 30 | 31 | If using the Summary plugin, make sure it appears in your plugin list before 32 | the Clean Summary plugin. For example: 33 | 34 | PLUGINS = ['summary', 'clean_summary', ... ] 35 | -------------------------------------------------------------------------------- /dateish/Readme.rst: -------------------------------------------------------------------------------- 1 | Dateish Plugin for Pelican 2 | ========================== 3 | 4 | This plugin adds the ability to treat arbitrary metadata fields as datetime 5 | objects. 6 | 7 | Usage 8 | ----- 9 | 10 | For example, if you have the following pieces of metadata in an article: 11 | 12 | .. code-block:: markdown 13 | 14 | # my_article.markdown 15 | Date: 2000-01-01 16 | Idea_Date: 1993-03-04 17 | Important_Dates: 2013-10-12 18 | 2013-11-08 19 | 2013-12-02 20 | 21 | Normally, the Idea_Date and Important_Dates variables will be strings, so 22 | you will not be able to use the strftime() Jinja filter on them. 23 | 24 | With this plugin, you define in your settings file a list of the names of 25 | the additional metadata fields you want to treat as dates: 26 | 27 | .. code-block:: python 28 | 29 | # pelicanconf.py 30 | DATEISH_PROPERTIES = ['idea_date', 'important_dates'] 31 | 32 | Then you can use them in templates just like date: 33 | 34 | .. code-block:: html+jinja 35 | 36 | # mytemplate.html 37 |

Idea date: {{ article.idea_date | strftime('%d %B %Y') }}

38 | {% for d in article.important_dates %} 39 |

Important date: {{ d | strftime('%d %B %Y') }}

40 | {% endfor %} 41 | 42 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/CSS-images.txt: -------------------------------------------------------------------------------- 1 | Images 2 | =============================================================================== 3 | 4 | Responsive images 5 | ----------------- 6 | 7 | Images in Bootstrap 3 can be made responsive-friendly via the addition of the 8 | .img-responsive class. This applies max-width: 100%; and height: auto; to the 9 | image so that it scales nicely to the parent element. 10 | 11 | 12 | .. code:: 13 | :class: highlight 14 | 15 | .. image:: image.png 16 | :class: img-responsive 17 | 18 | Image shapes 19 | ------------ 20 | 21 | Add classes to an `` element to easily style images in any project. 22 | 23 | 24 | .. callout:: danger 25 | 26 | :h4:`Cross-browser compatibility` 27 | Keep in mind that Internet Explorer 8 lacks support for rounded corners. 28 | 29 | 30 | .. container:: bs-example 31 | 32 | .. image:: 140x140.png 33 | :class: img-rounded 34 | 35 | .. image:: 140x140.png 36 | :class: img-circle 37 | 38 | .. image:: 140x140.png 39 | :class: img-thumbnail 40 | 41 | 42 | .. code:: 43 | :class: highlight 44 | 45 | .. image:: 140x140.png 46 | :class: img-rounded 47 | 48 | .. image:: 140x140.png 49 | :class: img-circle 50 | 51 | .. image:: 140x140.png 52 | :class: img-thumbnail 53 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-glyphicons.txt: -------------------------------------------------------------------------------- 1 | Glyphicons 2 | =============================================================================== 3 | 4 | Available glyphs 5 | ---------------- 6 | 7 | Includes 200 glyphs in font format from the Glyphicon Halflings 8 | set. `Glyphicons `_ Halflings are normally not available 9 | for free, but their creator has made them available for Bootstrap free of 10 | cost. As a thank you, we only ask that you include a link back to `Glyphicons 11 | `_ whenever possible. 12 | 13 | .. include:: glyphicons-list.txt 14 | 15 | How to use 16 | ---------- 17 | 18 | For performance reasons, all icons require a base class and individual icon 19 | class. To use, place the following code just about anywhere. Be sure to leave a 20 | space between the icon and text for proper padding. 21 | 22 | .. callout:: danger 23 | 24 | :h4:`Don't mix with other` 25 | Icon classes cannot be directly combined with other components. They should 26 | not be used along with other classes on the same element. Instead, add a 27 | nested `` and apply the icon classes to the ``. 28 | 29 | .. container:: bs-example 30 | 31 | |search| |star| 32 | 33 | 34 | .. code:: 35 | :class: highlight 36 | 37 | |search| |star| 38 | -------------------------------------------------------------------------------- /github_activity/Readme.rst: -------------------------------------------------------------------------------- 1 | GitHub activity 2 | --------------- 3 | 4 | This plugin makes use of the `feedparser`_ library that you'll need to 5 | install. 6 | 7 | Set the ``GITHUB_ACTIVITY_FEED`` parameter to your GitHub activity feed. 8 | For example, to track Pelican project activity, the setting would be:: 9 | 10 | GITHUB_ACTIVITY_FEED = 'https://github.com/getpelican.atom' 11 | 12 | If you want to limit the amount of entries to a certain maximum set the 13 | ``GITHUB_ACTIVITY_MAX_ENTRIES`` parameter. 14 | 15 | GITHUB_ACTIVITY_MAX_ENTRIES = 10 16 | 17 | On the template side, you just have to iterate over the ``github_activity`` 18 | variable, as in this example:: 19 | 20 | {% if GITHUB_ACTIVITY_FEED %} 21 | 30 | {% endif %} 31 | 32 | ``github_activity`` is a list of lists. The first element is the title, 33 | and the second element is the raw HTML from GitHub. 34 | 35 | .. _feedparser: https://crate.io/packages/feedparser/ 36 | -------------------------------------------------------------------------------- /better_tables/README.md: -------------------------------------------------------------------------------- 1 | # Better Tables 2 | 3 | This Pelican plugin removes the excess attributes and elements in the HTML 4 | tables generated from reST. Trimming this fat allows them to pass HTML5 5 | validation. Hopefully `rst2html5` will be merged into Pelican at some point, but 6 | until then, this hacky approach is needed. 7 | 8 | This approach has the advantage of restoring sanity to tables, and allows their 9 | column width to flow normally. All styling is default and must be styled by CSS 10 | rather than in HTML attributes. 11 | 12 | I make no claim that **all** HTML table crimes generated are corrected — merely 13 | the ones that I have stumbled across. 14 | 15 | ## Requirements 16 | 17 | * Beautiful Soup 4 18 | 19 | ## What does it do? 20 | 21 | At the moment, the following is stripped from tables (though when in doubt, 22 | check the source as it may be updated and out-of-sync with this document). 23 | 24 | * `` element (and its evil `` children) 25 | * `table` > `border` attribute 26 | * `` and `` > `valign` attribute 27 | 28 | ## Usage 29 | 30 | Enable the plugin in your pelicanconf.py: 31 | 32 | PLUGINS = [ 33 | # ... 34 | 'better_tables', 35 | # ... 36 | ] 37 | 38 | And that's it. Life's simple like that sometimes. 39 | -------------------------------------------------------------------------------- /simple_footnotes/test_simple_footnotes.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from simple_footnotes import parse_for_footnotes 3 | 4 | class PseudoArticleGenerator(object): 5 | articles = [] 6 | class PseudoArticle(object): 7 | _content = "" 8 | slug = "article" 9 | 10 | class TestFootnotes(unittest.TestCase): 11 | 12 | def _expect(self, input, expected_output): 13 | ag = PseudoArticleGenerator() 14 | art = PseudoArticle() 15 | art._content = input 16 | ag.articles = [art] 17 | parse_for_footnotes(ag) 18 | self.assertEqual(art._content, expected_output) 19 | 20 | def test_simple(self): 21 | self._expect("words[ref]footnote[/ref]end", 22 | ('words1end' 24 | '
    ' 25 | u'
  1. footnote \u21a9
  2. ' 26 | '
')) 27 | 28 | def test_no_footnote_inside_code(self): 29 | self._expect("wordsthis is code[ref]footnote[/ref] end code end", 30 | "wordsthis is code[ref]footnote[/ref] end code end") 31 | 32 | if __name__ == '__main__': 33 | unittest.main() -------------------------------------------------------------------------------- /w3c_validate/README.md: -------------------------------------------------------------------------------- 1 | # w3c_validate plugin 2 | 3 | This is a plugin for Pelican that submits generated HTML content to the 4 | [W3C Markup Validation Service](http://validator.w3.org/). 5 | 6 | After all content is generated, the output folder is traversed for HTML files, 7 | and the content is submitted to the W3C validator, after which the results 8 | are displayed. For example: 9 | 10 | -> writing /tmp/_output/sitemap.xml 11 | -> Validating: /tmp/_output/archives.html 12 | ERROR: line: 2; col: 52; message: Bad value http://www.w3.org/1999/html for the attribute xmlns (only http://www.w3. 13 | -> Validating: /tmp/_output/categories.html 14 | ERROR: line: 2; col: 52; message: Bad value http://www.w3.org/1999/html for the attribute xmlns (only http://www.w3. 15 | 16 | **Note**: The above output assumes you have called Pelican with the ``--debug`` 17 | flag. Otherwise, you will see errors (if any) but not the file currently being 18 | validated. 19 | 20 | ## Dependencies 21 | 22 | * [py_w3c](https://pypi.python.org/pypi/py_w3c/0.1.0), which can be installed with pip: 23 | 24 | $ pip install py_w3c 25 | 26 | ## Instructions 27 | 28 | Add `w3c_validate` to your config file's plugins after installing dependencies - `PLUGINS = ['w3c_validate']` 29 | 30 | ## TODO 31 | 32 | [ ] - add tests 33 | 34 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/pages/untranslated-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Untranslated page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 18 |

Untranslated page

19 | 20 | 21 |

This page has no translation.

22 | 23 | 24 |
25 |
26 | Proudly powered by Pelican, 27 | which takes great advantage of Python. 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/de/pages/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Eine 404 Seite 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 17 |

Eine 404 Seite

18 | Translations: 19 | cz 20 | en 21 | 22 | 23 |

Eine einfache 404 Seite.

24 | 25 | 26 |
27 |
28 | Proudly powered by Pelican, 29 | which takes great advantage of Python. 30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/static/css/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | Name: Reset Stylesheet 3 | Description: Resets browser's default CSS 4 | Author: Eric Meyer 5 | Author URI: http://meyerweb.com/eric/tools/css/reset/ 6 | */ 7 | 8 | /* v1.0 | 20080212 */ 9 | html, body, div, span, applet, object, iframe, 10 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 11 | a, abbr, acronym, address, big, cite, code, 12 | del, dfn, em, font, img, ins, kbd, q, s, samp, 13 | small, strike, strong, sub, sup, tt, var, 14 | b, u, i, center, 15 | dl, dt, dd, ol, ul, li, 16 | fieldset, form, label, legend, 17 | table, caption, tbody, tfoot, thead, tr, th, td { 18 | background: transparent; 19 | border: 0; 20 | font-size: 100%; 21 | margin: 0; 22 | outline: 0; 23 | padding: 0; 24 | vertical-align: baseline; 25 | } 26 | 27 | body {line-height: 1;} 28 | 29 | ol, ul {list-style: none;} 30 | 31 | blockquote, q {quotes: none;} 32 | 33 | blockquote:before, blockquote:after, 34 | q:before, q:after { 35 | content: ''; 36 | content: none; 37 | } 38 | 39 | /* remember to define focus styles! */ 40 | :focus { 41 | outline: 0; 42 | } 43 | 44 | /* remember to highlight inserts somehow! */ 45 | ins {text-decoration: none;} 46 | del {text-decoration: line-through;} 47 | 48 | /* tables still need 'cellspacing="0"' in the markup */ 49 | table { 50 | border-collapse: collapse; 51 | border-spacing: 0; 52 | } -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/cz/pages/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 stránka 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 17 |

404 stránka

18 | Translations: 19 | de 20 | en 21 | 22 | 23 |

Jednoduchá 404 stránka.

24 | 25 | 26 |
27 |
28 | Proudly powered by Pelican, 29 | which takes great advantage of Python. 30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /linker/mailto.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import absolute_import 3 | 4 | import codecs 5 | 6 | from pelican import signals 7 | from pelican.generators import Generator 8 | 9 | from linker import linker 10 | 11 | def encode_mailto_link(mailto): 12 | return 'mailto/' + codecs.encode(mailto, 'rot_13') + '/' 13 | 14 | class MailtoLinker(linker.LinkerBase): 15 | commands = ['mailto'] 16 | 17 | def link(self, link): 18 | mailto = link.path 19 | 20 | link.path = '/' + encode_mailto_link(mailto) # a.href for JS parsing 21 | link.context['mailtos'].add(mailto) # remember mail address for fallback 22 | 23 | 24 | class MailtoFallbackGenerator(Generator): 25 | def generate_context(self): 26 | self.context['mailtos'] = set() # populated on {mailto} link processing 27 | 28 | def generate_output(self, writer): 29 | for mailto in self.context['mailtos']: 30 | save_as = encode_mailto_link(mailto) + 'index.html' 31 | 32 | writer.write_file(save_as, self.get_template('mailto_fallback'), 33 | self.context, mailto=mailto) 34 | 35 | 36 | def return_mailto_fallback_generator(generators): 37 | return MailtoFallbackGenerator 38 | 39 | def register(): 40 | linker.register() 41 | signals.get_generators.connect(return_mailto_fallback_generator) 42 | -------------------------------------------------------------------------------- /members/members.py: -------------------------------------------------------------------------------- 1 | """ 2 | Members info plugin for Pelican 3 | =============================== 4 | 5 | This plugin looks for a ``members`` metadata header containing key/value pairs 6 | and makes them available for use in templates 7 | 8 | The first line of the members metadata defines each key, and the following 9 | lines contain corresponding values for each member. 10 | 11 | :members: nome, email, twitter, github, site_nome, site_href 12 | Danilo Shiga, daniloshiga@gmail.com, @daneoshiga, daneoshiga, Danilo Shiga, http://daniloshiga.com 13 | """ 14 | 15 | from collections import OrderedDict 16 | 17 | from pelican import signals 18 | 19 | 20 | def add_members(generator, metadata): 21 | 22 | if 'members' in metadata.keys(): 23 | # Dealing with differences on metadata for md and rst content 24 | if type(metadata['members']) == list: 25 | members = metadata['members'] 26 | else: 27 | members = metadata['members'].splitlines() 28 | 29 | metadata['members'] = OrderedDict() 30 | keys = map(unicode.strip, members[0].split(',')) 31 | for member in members[1:]: 32 | values = map(unicode.strip, member.split(',')) 33 | member_dict = dict(zip(keys, values)) 34 | metadata['members'][member_dict['nome']] = member_dict 35 | 36 | 37 | def register(): 38 | signals.page_generator_context.connect(add_members) 39 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/pelicanconf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- # 3 | from __future__ import unicode_literals 4 | 5 | AUTHOR = 'The Tester' 6 | SITENAME = 'Testing site' 7 | SITEURL = 'http://example.com/test' 8 | 9 | # to make the test suite portable 10 | TIMEZONE = 'UTC' 11 | 12 | DEFAULT_LANG = 'en' 13 | LOCALE = 'en_US.UTF-8' 14 | 15 | # Generate only one feed 16 | FEED_ALL_ATOM = 'feeds_all.atom.xml' 17 | CATEGORY_FEED_ATOM = None 18 | TRANSLATION_FEED_ATOM = None 19 | AUTHOR_FEED_ATOM = None 20 | AUTHOR_FEED_RSS = None 21 | 22 | # Disable unnecessary pages 23 | CATEGORY_SAVE_AS = '' 24 | TAG_SAVE_AS = '' 25 | AUTHOR_SAVE_AS = '' 26 | ARCHIVES_SAVE_AS = '' 27 | AUTHORS_SAVE_AS = '' 28 | CATEGORIES_SAVE_AS = '' 29 | TAGS_SAVE_AS = '' 30 | 31 | PLUGIN_PATHS = ['../../'] 32 | PLUGINS = ['i18n_subsites'] 33 | 34 | THEME = 'localized_theme' 35 | JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']} 36 | 37 | from blinker import signal 38 | tmpsig = signal('tmpsig') 39 | I18N_FILTER_SIGNALS = [tmpsig] 40 | 41 | I18N_SUBSITES = { 42 | 'de': { 43 | 'SITENAME': 'Testseite', 44 | 'AUTHOR': 'Der Tester', 45 | 'LOCALE': 'de_DE.UTF-8', 46 | }, 47 | 'cz': { 48 | 'SITENAME': 'Testovací stránka', 49 | 'AUTHOR': 'Test Testovič', 50 | 'I18N_UNTRANSLATED_PAGES': 'remove', 51 | 'I18N_UNTRANSLATED_ARTICLES': 'keep', 52 | }, 53 | } 54 | -------------------------------------------------------------------------------- /pelican_comment_system/identicon/LICENSE: -------------------------------------------------------------------------------- 1 | identicon.py is Licesensed under FreeBSD License. 2 | (http://www.freebsd.org/copyright/freebsd-license.html) 3 | 4 | Copyright 1994-2009 Shin Adachi. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /static_comments/static_comments.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import codecs 4 | import logging 5 | import markdown 6 | import os 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | from pelican import signals 11 | 12 | 13 | def initialized(pelican): 14 | from pelican.settings import DEFAULT_CONFIG 15 | DEFAULT_CONFIG.setdefault('STATIC_COMMENTS', False) 16 | DEFAULT_CONFIG.setdefault('STATIC_COMMENTS_DIR' 'comments') 17 | if pelican: 18 | pelican.settings.setdefault('STATIC_COMMENTS', False) 19 | pelican.settings.setdefault('STATIC_COMMENTS_DIR', 'comments') 20 | 21 | 22 | def add_static_comments(gen, metadata): 23 | if gen.settings['STATIC_COMMENTS'] != True: 24 | return 25 | 26 | if not 'slug' in metadata: 27 | logger.warning("static_comments: " 28 | "cant't locate comments file without slug tag in the article") 29 | return 30 | 31 | fname = os.path.join(gen.settings['STATIC_COMMENTS_DIR'], 32 | metadata['slug'] + ".md") 33 | 34 | if not os.path.exists(fname): 35 | return 36 | 37 | input_file = codecs.open(fname, mode="r", encoding="utf-8") 38 | text = input_file.read() 39 | html = markdown.markdown(text) 40 | 41 | metadata['static_comments'] = html 42 | 43 | 44 | def register(): 45 | signals.initialized.connect(initialized) 46 | signals.article_generator_context.connect(add_static_comments) 47 | -------------------------------------------------------------------------------- /test_data/themes/notmyidea/templates/article.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block title %}{{ article.title|striptags }}{% endblock %} 3 | {% block content %} 4 |
5 |
6 |
7 |

8 | {{ article.title}}

10 | {% include 'twitter.html' %} 11 |
12 | 13 |
14 | {% include 'article_infos.html' %} 15 | {{ article.content }} 16 |
17 | {% if DISQUS_SITENAME and SITEURL and article.status != "draft" %} 18 |
19 |

Comments !

20 |
21 | 30 |
31 | {% endif %} 32 | 33 |
34 |
35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /i18n_subsites/test_data/output/pages/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A 404 page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 18 |

A 404 page

19 | Translations: 20 | cz 21 | de 22 | 23 | 24 |

A simple 404 page.

25 | 26 | 27 |
28 |
29 | Proudly powered by Pelican, 30 | which takes great advantage of Python. 31 |
32 |
33 | 34 | -------------------------------------------------------------------------------- /better_tables/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Alex Waite 2 | # Permission is hereby granted, free of charge, to any person obtaining a copy 3 | # of this software and associated documentation files (the "Software"), to deal 4 | # in the Software without restriction, including without limitation the rights 5 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | # copies of the Software, and to permit persons to whom the Software is 7 | # furnished to do so, subject to the following conditions: 8 | 9 | # The above copyright notice and this permission notice shall be included in 10 | # all copies or substantial portions of the Software. 11 | 12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY 14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 | # SOFTWARE. 19 | 20 | # -*- coding: utf-8 -*- 21 | __title__ = 'better-tables' 22 | __version__ = '0.1.0' 23 | __author__ = 'Alex Waite' 24 | __credits__ = ["Alex Waite"] 25 | __maintainer__ = "Alex Waite" 26 | __email__ = "Alexqw85@gmail.com" 27 | __status__ = "Stable" 28 | __license__ = 'MIT' 29 | __copyright__ = 'Copyright 2015' 30 | 31 | from .better_tables import * 32 | -------------------------------------------------------------------------------- /html_entity/html_entity.py: -------------------------------------------------------------------------------- 1 | """ 2 | HTML Entities for reStructured Text 3 | =================================== 4 | 5 | Allows user to use HTML entities (©, •, etc.) in RST documents. 6 | 7 | Usage: 8 | :html_entity:`copy` 9 | :html_entity:`149` 10 | :html_entity:`#149` 11 | """ 12 | from __future__ import unicode_literals 13 | from docutils import nodes, utils 14 | from docutils.parsers.rst import roles 15 | from pelican.readers import PelicanHTMLTranslator 16 | import six 17 | 18 | 19 | class html_entity(nodes.Inline, nodes.Node): 20 | # Subclassing Node directly since TextElement automatically appends the escaped element 21 | def __init__(self, rawsource, text): 22 | self.rawsource = rawsource 23 | self.text = text 24 | self.children = [] 25 | self.attributes = {} 26 | 27 | def astext(self): 28 | return self.text 29 | 30 | 31 | def entity_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): 32 | text = utils.unescape(text) 33 | entity_code = text 34 | try: 35 | entity_code = "#{}".format(six.u(int(entity_code))) 36 | except ValueError: 37 | pass 38 | entity_code = "&{};".format(entity_code) 39 | return [html_entity(text, entity_code)], [] 40 | 41 | 42 | def register(): 43 | roles.register_local_role('html_entity', entity_role) 44 | 45 | PelicanHTMLTranslator.visit_html_entity = lambda self, node: self.body.append(node.astext()) 46 | PelicanHTMLTranslator.depart_html_entity = lambda self, node: None 47 | -------------------------------------------------------------------------------- /org_reader/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Matthew Snyder, http://msnyder.info 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | -------------------------------------------------------------------------------- /pelican_comment_system/doc/avatars.md: -------------------------------------------------------------------------------- 1 | # Avatars and Identicons 2 | To activate the avatars and [identicons](https://en.wikipedia.org/wiki/Identicon) you have to set `PELICAN_COMMENT_SYSTEM_IDENTICON_DATA`. 3 | 4 | ##### Example 5 | ```python 6 | PELICAN_COMMENT_SYSTEM_IDENTICON_DATA = ('author',) 7 | ``` 8 | Now every comment with the same author tag will be treated as if written from the same person. And therefore have the same avatar/identicon. Of cause you can modify this tuple so other metadata are checked. 9 | 10 | ## Specific Avatars 11 | To set a specific avatar for a author you have to add them to the `PELICAN_COMMENT_SYSTEM_AUTHORS` dictionary. 12 | 13 | The `key` of the dictionary has to be a tuple of the form of `PELICAN_COMMENT_SYSTEM_IDENTICON_DATA`, so in our case only the author's name. 14 | 15 | The `value` of the dictionary is the path to the specific avatar. 16 | 17 | ##### Example 18 | ```python 19 | PELICAN_COMMENT_SYSTEM_AUTHORS = { 20 | ('John',): "images/authors/john.png", 21 | ('Tom',): "images/authors/tom.png", 22 | } 23 | ``` 24 | 25 | ## Theme 26 | To display the avatars and identicons simply add the following in the "comment for loop" in your theme: 27 | 28 | ```html 29 | Avatar 33 | ``` 34 | 35 | Of cause the `height` and `width` are optional, but they make sure that everything has the same size (in particular specific avatars). 36 | -------------------------------------------------------------------------------- /liquid_tags/spotify.py: -------------------------------------------------------------------------------- 1 | """ 2 | Spotify Tag 3 | --------- 4 | This implements a Liquid-style spotify tag for Pelican, 5 | based on the jekyll / octopress youtube tag [1]_ 6 | 7 | Syntax 8 | ------ 9 | {% spotify id %} 10 | 11 | Example 12 | ------- 13 | {% spotify 1HNZcRFlIKwHAJD3LxvX4d %} 14 | 15 | Output 16 | ------ 17 | 21 | """ 22 | import re 23 | from .mdx_liquid_tags import LiquidTags 24 | 25 | SYNTAX = "{% spotify id %}" 26 | 27 | SPOTIFY = re.compile(r'(\w+)(\s+(\d+)\s(\d+))?') 28 | 29 | 30 | @LiquidTags.register('spotify') 31 | def spotify(preprocessor, tag, markup): 32 | spotify_id = None 33 | 34 | match = SPOTIFY.search(markup) 35 | if match: 36 | groups = match.groups() 37 | spotify_id = groups[0] 38 | 39 | if spotify_id: 40 | spotify_out = """ 41 | """.format(spotify_id).strip() 46 | else: 47 | raise ValueError("Error processing input, " 48 | "expected syntax: {0}".format(SYNTAX)) 49 | 50 | return spotify_out 51 | 52 | 53 | # --------------------------------------------------- 54 | # This import allows image tag to be a Pelican plugin 55 | from liquid_tags import register # noqa 56 | -------------------------------------------------------------------------------- /custom_article_urls/README.md: -------------------------------------------------------------------------------- 1 | #Custom Article URLs# 2 | 3 | This plugin adds support for defining different default URLs for different 4 | categories, or different subcategories if using the subcategory plugin. 5 | 6 | ##Usage## 7 | 8 | After adding `custom_article_urls` to your `PLUGINS`, add a 9 | `CUSTOM_ARTICLE_URLS` setting, which is a dictionary of rules. The rules are 10 | also a dictionary, consisting of the `URL` and the `SAVE_AS` values. 11 | 12 | For example, if you had two categories, *Category 1* and *Category 2*, and you 13 | would like *Category 1* saved as `category-1/article-slug/` and *Category 2* 14 | saved as `/year/month/article-slug/`, you would add: 15 | 16 | CUSTOM_ARTICLE_URLS = { 17 | 'Category 1': {'URL': '{category}/{slug}/', 18 | 'SAVE_AS': '{category}/{slug}/index.html}', 19 | 'Category 2': {'URL': '{date:%Y}/{date:%B}/{slug}/', 20 | 'SAVE_AS': '{date:%Y}/{date:%B}/{slug}/index.html}', 21 | } 22 | 23 | If you had any other categories, they would use the default `ARTICLE_SAVE_AS` 24 | and `ARTICLE_URL` settings. 25 | 26 | If you are using the subcategory plugin, you can define them the same way. 27 | For example, if *Category 1* had a subcategory called *Sub Category*, you could 28 | define its rules with:: 29 | 30 | 'Category 1/Sub Category`: ... 31 | 32 | ##Other Usage: Article Metadata## 33 | 34 | If you define `URL` and `Save_as` in your article metadata, then this plugin 35 | will not alter that value. So you can still specify special one-off URLs as 36 | you normally would. 37 | -------------------------------------------------------------------------------- /txt2tags_reader/txt2tags_reader.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | from pelican import signals 3 | from pelican.readers import BaseReader 4 | from pelican.utils import pelican_open 5 | 6 | class Txt2tagsReader(BaseReader): 7 | enabled = True 8 | file_extensions = ['t2t', 'txt2tags'] 9 | 10 | def read(self, filename): 11 | with pelican_open(filename) as fp: 12 | text = list(fp.splitlines()) 13 | 14 | metadata = {} 15 | for i, line in enumerate(text): 16 | kv = line.split(':', 1) 17 | if len(kv) == 2: 18 | name, value = kv[0].lower(), kv[1].strip() 19 | metadata[name] = self.process_metadata(name, value) 20 | else: 21 | content = "\n".join(text[i:]) 22 | break 23 | 24 | t2t_cmd = [r"txt2tags", r"--encoding=utf-8", r"--target=html", r"--infile=-", r"--outfile=-", r"--no-headers"] 25 | 26 | proc = subprocess.Popen(t2t_cmd, 27 | stdin = subprocess.PIPE, 28 | stdout = subprocess.PIPE) 29 | 30 | output = proc.communicate(content.encode('utf-8'))[0].decode('utf-8') 31 | status = proc.wait() 32 | if status: 33 | raise subprocess.CalledProcessError(status, t2t_cmd) 34 | 35 | return output, metadata 36 | 37 | def add_reader(readers): 38 | for ext in Txt2tagsReader.file_extensions: 39 | readers.reader_classes[ext] = Txt2tagsReader 40 | 41 | def register(): 42 | signals.readers_init.connect(add_reader) 43 | -------------------------------------------------------------------------------- /bootstrap-rst/README.rst: -------------------------------------------------------------------------------- 1 | Bootstrap RST for Pelican 2 | ========================= 3 | 4 | This plugin merely adds what little glue is needed to make bootstrap-rst play 5 | nicely with Pelican. All credit goes to **Nicolas P. Rougier**. 6 | 7 | It is much more featureful than the 'twitter_bootstrap_rst_directives' plugin. 8 | 9 | Usage 10 | ----- 11 | Enable the plugin in your `pelicanconf.py` 12 | 13 | PLUGINS = [ 14 | 'bootstrap-rst' 15 | ] 16 | 17 | And then use any of the many fine directives made available. Peruse the `doc` 18 | folder for more information. 19 | 20 | Bootstrap RST 21 | ============= 22 | 23 | Bootstrap RST offers an easy access to the `bootstrap `_ 24 | framework using the `reStructuredText `_ 25 | markup language. Bootstrap RST provides a set of new directives and roles (row, 26 | column, button, list, etc.) that allow seamless integration of the bootstrap 27 | framework. Have a look at the source of this page for example and see below for 28 | what is available so far. 29 | 30 | See demo at: `http://rougier.github.io/bootstrap-rst/ `_. 31 | 32 | Creators 33 | ======== 34 | 35 | **Nicolas P. Rougier** : 36 | 37 | * `http://www.labri.fr/perso/nrougier/ `_ 38 | * `https://github.com/rougier `_ 39 | 40 | Copyright and License 41 | ===================== 42 | 43 | Code and documentation copyright 2014 Nicolas P. Rougier. 44 | Code released under the MIT license. Docs released under CC BY 3.0. 45 | -------------------------------------------------------------------------------- /liquid_tags/pelicanhtml_2.tpl: -------------------------------------------------------------------------------- 1 | {%- extends 'basic.tpl' -%} 2 | 3 | {% block stream_stdout -%} 4 |
5 |
{{output.text |ansi2html}}
6 |
7 | {%- endblock stream_stdout %} 8 | 9 | {% block stream_stderr -%} 10 |
11 |
{{output.text |ansi2html}}
12 |
13 | {%- endblock stream_stderr %} 14 | 15 | {% block pyerr -%} 16 |
17 |
{{super()}}
18 |
19 | {%- endblock pyerr %} 20 | 21 | {%- block data_text %} 22 |
{{output.text | ansi2html}}
23 | {%- endblock -%} 24 | 25 | {% block input %} 26 | {% if "# " in cell.input %} 27 |
Expand Code 28 | 31 |
32 | {% elif "# " in cell.input %} 33 |
Collapse Code 34 |
35 | {{ cell.input.replace("# \n", "") | highlight2html(metadata=cell.metadata) }} 36 |
37 |
38 | {% else %} 39 |
40 | {{ cell.input | highlight2html(metadata=cell.metadata) }} 41 |
42 | {% endif %} 43 | {%- endblock input %} 44 | 45 | -------------------------------------------------------------------------------- /liquid_tags/pelicanhtml_1.tpl: -------------------------------------------------------------------------------- 1 | {%- extends 'html_basic.tpl' -%} 2 | 3 | {% block stream_stdout -%} 4 |
5 |
{{output.text |ansi2html}}
6 |
7 | {%- endblock stream_stdout %} 8 | 9 | {% block stream_stderr -%} 10 |
11 |
{{output.text |ansi2html}}
12 |
13 | {%- endblock stream_stderr %} 14 | 15 | {% block pyerr -%} 16 |
17 |
{{super()}}
18 |
19 | {%- endblock pyerr %} 20 | 21 | {%- block data_text %} 22 |
{{output.text | ansi2html}}
23 | {%- endblock -%} 24 | 25 | {% block input %} 26 | {% if "# " in cell.input %} 27 |
Expand Code 28 | 31 |
32 | {% elif "# " in cell.input %} 33 |
Collapse Code 34 |
35 | {{ cell.input.replace("# \n", "") | highlight2html(metadata=cell.metadata) }} 36 |
37 |
38 | {% else %} 39 |
40 | {{ cell.input | highlight2html(metadata=cell.metadata) }} 41 |
42 | {% endif %} 43 | {%- endblock input %} 44 | 45 | -------------------------------------------------------------------------------- /post_stats/readability.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Adadpted from here: http://acdx.net/calculating-the-flesch-kincaid-level-in-python/ 4 | # See here for details: http://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_test 5 | 6 | from __future__ import division 7 | import re 8 | 9 | 10 | def mean(seq): 11 | return sum(seq) / len(seq) 12 | 13 | 14 | def syllables(word): 15 | if len(word) <= 3: 16 | return 1 17 | 18 | word = re.sub(r"(es|ed|(?= 2] 34 | 35 | if wc: 36 | words = wc 37 | else: 38 | words = sum(len(s) for s in stcs) 39 | 40 | sbls = sum(syllables(w) for s in stcs for w in s) 41 | 42 | return len(stcs), words, sbls 43 | 44 | 45 | def flesch_index(stats): 46 | stcs, words, sbls = stats 47 | if stcs == 0 or words == 0: 48 | return 0 49 | return 206.835 - 1.015 * (words / stcs) - 84.6 * (sbls / words) 50 | 51 | 52 | def flesch_kincaid_level(stats): 53 | stcs, words, sbls = stats 54 | if stcs == 0 or words == 0: 55 | return 0 56 | return 0.39 * (words / stcs) + 11.8 * (sbls / words) - 15.59 57 | -------------------------------------------------------------------------------- /autopages/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Magnetic Media Online, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from this 16 | software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /liquid_tags/test_audio.py: -------------------------------------------------------------------------------- 1 | from . import audio 2 | import pytest 3 | import re 4 | 5 | 6 | @pytest.mark.parametrize('input,expected', [ 7 | ('http://foo.bar https://bar.foo', 8 | ('http://foo.bar', 'https://bar.foo', None)), 9 | ('http://test.foo', 10 | ('http://test.foo', None, None)), 11 | ('https://test.foo', 12 | ('https://test.foo', None, None)), 13 | ('http://foo.foo https://bar.bar http://zonk.zonk', 14 | ('http://foo.foo', 'https://bar.bar', 'http://zonk.zonk')) 15 | ]) 16 | def test_regex(input, expected): 17 | assert re.match(audio.AUDIO, input).groups() == expected 18 | 19 | 20 | @pytest.mark.parametrize('input,expected', [ 21 | ('http://foo.foo/foo.mp3', 22 | ('')), 25 | ('https://foo.foo/foo.ogg http://bar.bar/bar.opus', 26 | ('')), 30 | ('http://1.de/1.wav http://2.de/2.mp4 http://3.de/3.ogg', 31 | ('')) 36 | ]) 37 | def test_create_html(input, expected): 38 | assert audio.create_html(input) == expected 39 | -------------------------------------------------------------------------------- /slim/README.md: -------------------------------------------------------------------------------- 1 | # Slim 2 | 3 | This plugin uses [Plim](http://plim.readthedocs.org/en/latest/), the Python port of [Slim](http://slim-lang.com), to render your theme's template files, instead of Jinja2. It works best if you have (handcrafted and are using) a Plim based theme. :) 4 | 5 | ## Installation 6 | 7 | This plugin depends on the plim, beautifulsoup4, and htmlmin, which can be installed via pip: 8 | 9 | ``` 10 | pip install plim 11 | pip install beautifulsoup4 12 | pip install htmlmin 13 | ``` 14 | 15 | If you downloaded this module as part of the pelican-plugins repository, add it to your Pelican configuration as follows: 16 | 17 | ``` 18 | PLUGIN_PATH = '/path/to/pelican-plugins' 19 | PLUGINS = ['slim', ] 20 | ``` 21 | 22 | Otherwise, you can import it into Python as a normal module if you place this repository in your $PYTHONPATH. 23 | 24 | ## Usage 25 | 26 | This plugin will break your Pelican project unless you are using a theme that follows the Plim syntax. As of 2015-04-24 Plim has not yet taken over the world, so if you want to use it, it probably means you need to write your own Plim theme before this plugin will be useful. 27 | 28 | Once you've installed your Plim syntax theme, enabled the plugin and installed the dependencies listed above, you use Pelican normally to generate your site. 29 | 30 | ## Settings 31 | 32 | Add `SLIM_OPTIONS = {'PRETTYIFY': True}` to pelicanconf.py to get prettyified HTML. 33 | 34 | ## About 35 | 36 | This plugin is a bit of a hack. It copies the builtin Writer and replaces the final rendering step, swapping out Jinja2 with Plim and then minifying or prettifying the HTML output. 37 | -------------------------------------------------------------------------------- /test_data/pelican.conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | AUTHOR = 'Alexis Métaireau' 5 | SITENAME = "Alexis' log" 6 | SITEURL = 'http://blog.notmyidea.org' 7 | TIMEZONE = "Europe/Paris" 8 | 9 | GITHUB_URL = 'http://github.com/ametaireau/' 10 | DISQUS_SITENAME = "blog-notmyidea" 11 | PDF_GENERATOR = False 12 | REVERSE_CATEGORY_ORDER = True 13 | LOCALE = "C" 14 | DEFAULT_PAGINATION = 4 15 | DEFAULT_DATE = (2012, 3, 2, 14, 1, 1) 16 | 17 | FEED_ALL_RSS = 'feeds/all.rss.xml' 18 | CATEGORY_FEED_RSS = 'feeds/%s.rss.xml' 19 | 20 | LINKS = (('Biologeek', 'http://biologeek.org'), 21 | ('Filyb', "http://filyb.info/"), 22 | ('Libert-fr', "http://www.libert-fr.com"), 23 | ('N1k0', "http://prendreuncafe.com/blog/"), 24 | ('Tarek Ziadé', "http://ziade.org/blog"), 25 | ('Zubin Mithra', "http://zubin71.wordpress.com/"),) 26 | 27 | SOCIAL = (('twitter', 'http://twitter.com/ametaireau'), 28 | ('lastfm', 'http://lastfm.com/user/akounet'), 29 | ('github', 'http://github.com/ametaireau'),) 30 | 31 | # global metadata to all the contents 32 | DEFAULT_METADATA = (('yeah', 'it is'),) 33 | 34 | # static paths will be copied under the same name 35 | STATIC_PATHS = ["pictures", ] 36 | 37 | # A list of files to copy from the source to the destination 38 | FILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),) 39 | 40 | # custom page generated with a jinja2 template 41 | TEMPLATE_PAGES = {'pages/jinja2_template.html': 'jinja2_template.html'} 42 | 43 | # foobar will not be used, because it's not in caps. All configuration keys 44 | # have to be in caps 45 | foobar = "barbaz" 46 | -------------------------------------------------------------------------------- /bootstrap-rst/custom.css: -------------------------------------------------------------------------------- 1 | /* Swap h2/h3 sizes */ 2 | /* h2,.h2 { font-size: 24px; }*/ 3 | /*h3,.h3 { font-size: 30px; }*/ 4 | 5 | /* sidebar title */ 6 | .sidebar-title { display: none; } 7 | .sidebar .topic-title { display: none; } 8 | 9 | /* admonition title */ 10 | .admonition-title { display: none; } 11 | 12 | 13 | /* page header h1 */ 14 | .section > h1 { 15 | padding-bottom: 9px; 16 | margin: 40px 0 20px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | 21 | /* Sidebar */ 22 | .sidebar ul { 23 | font-size: 110%; 24 | padding: 0; 25 | margin: 0; 26 | list-style: none; 27 | /*padding-top: .5em;*/ 28 | padding-bottom: 1em; 29 | } 30 | 31 | .sidebar p { 32 | padding: 0; 33 | margin: 0; 34 | padding-bottom: .1em; 35 | } 36 | 37 | .sidebar ul p { 38 | text-align: left; 39 | padding: 0; 40 | margin: 0; 41 | padding-top: .25em; 42 | } 43 | 44 | .sidebar ul ul { 45 | font-size: 85%; 46 | padding: 0; 47 | margin: 0; 48 | list-style: none; 49 | margin-top: .5em; 50 | margin-bottom: .5em; 51 | margin-left: 10px; 52 | padding-left: 10px; 53 | border-left: 1px solid #eeeeff; 54 | } 55 | .sidebar ul ul p { 56 | padding: 0; 57 | margin: 0; 58 | padding-top: .25em; 59 | } 60 | 61 | /* kbd -> .kbd */ 62 | .kbd { 63 | font-family: monospace, monospace; 64 | font-size: 1em; 65 | } 66 | .kbd { 67 | font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 68 | } 69 | .kbd { 70 | padding: 2px 4px; 71 | font-size: 90%; 72 | color: #fff; 73 | background-color: #333; 74 | border-radius: 3px; 75 | box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); 76 | } 77 | -------------------------------------------------------------------------------- /filetime_from_hg/README.rst: -------------------------------------------------------------------------------- 1 | Use Mercurial commit to determine page date 2 | =========================================== 3 | 4 | If your blog content is versioned via Mercurial, this plugin will set 5 | articles' and pages' ``metadata['date']`` to correspond to that of the 6 | hg commit. This plugin depends on the ``hglib`` python package, 7 | which can be installed via:: 8 | 9 | sudo apt-get install python-hglib 10 | 11 | or:: 12 | 13 | pip install hglib 14 | 15 | The date is determined via the following logic: 16 | 17 | * if a file is not tracked by hg, or a file is added but never committed 18 | - metadata['date'] = filesystem time 19 | - metadata['modified'] = filesystem time 20 | * if a file is tracked, but no changes in working directory 21 | - metadata['date'] = first commit time 22 | - metadata['modified'] = last commit time 23 | * if a file is tracked, and has changes in working directory 24 | - metadata['date'] = first commit time 25 | - metadata['modified'] = filesystem time 26 | 27 | When this module is enabled, ``date`` and ``modified`` will be determined 28 | by hg status; no need to manually set in article/page metadata. And 29 | operations like copy and move will not affect the generated results. 30 | 31 | If you don't want a given article or page to use the hg time, set the 32 | metadata to ``hgtime: off`` to disable it. 33 | 34 | You can also set ``HG_FILETIME_FOLLOW`` to ``True`` in your settings to 35 | make the plugin follow file renames — i.e., ensure the creation date matches 36 | the original file creation date, not the date it was renamed. 37 | 38 | Credits 39 | ======= 40 | 41 | This plugin is based on filetime_from_git. 42 | -------------------------------------------------------------------------------- /linker/Readme.md: -------------------------------------------------------------------------------- 1 | # Linker 2 | 3 | This plugin allows to define custom linker commands in analogy to the builtin 4 | `{filename}`, `{attach}`, `{category}`, `{tag}`, `{author}`, and `{index}` 5 | syntax. 6 | 7 | ## Provided commands (each of which in its own submodule) 8 | 9 | ### `{mailto}` 10 | 11 | **Purpose:** Helps to create `mailto:` links with javascript (JS) on top of a 12 | non-JS fallback. 13 | 14 | * **How the HTML code is replaced step by step** 15 | * your code in a content file (page or article): 16 | 17 | ``` 18 | Send me a mail 19 | ``` 20 | 21 | * plugin replacement (after computing `'jroznfgre' = rot_13('webmaster')`): 22 | 23 | ``` 24 | Send me a mail 25 | ``` 26 | 27 | * result of a JS-powered transform (which you could add): 28 | 29 | ``` 30 | Send me a mail 31 | ``` 32 | 33 | * As a fallback for users without JS, the static page 34 | `mailto/jroznfgre/index.html` is generated using the template 35 | `mailto_fallback`. 36 | 37 | * **Usage instruction** 38 | * activate nested `{mailto}` plugin using 39 | 40 | ``` 41 | PLUGINS = ['linker.mailto'] 42 | ``` 43 | 44 | * provide the `mailto_fallback` template (accessing `mailto` which is injected 45 | into the template) 46 | * optionally, add some JS to improve the user experience as sketched above 47 | 48 | ## Other included submodules 49 | 50 | ### `content_objects` 51 | 52 | This plugin collects all `pelican.contents.Content` instances in a `set` which 53 | can be accessed using `context['content_objects']`. -------------------------------------------------------------------------------- /liquid_tags/test_data/flickr.json: -------------------------------------------------------------------------------- 1 | {"photo":{"id":"18841055371","secret":"17ac287217","server":"5552","farm":6,"dateuploaded":"1434394882","isfavorite":0,"license":"4","safety_level":"0","rotation":0,"originalsecret":"ee4b63c8d8","originalformat":"jpg","owner":{"nsid":"8810721@N07","username":"marvinxsteadfast","realname":"","location":"","iconserver":"0","iconfarm":0,"path_alias":"marvinxsteadfast"},"title":{"_content":"fichte"},"description":{"_content":"Processed with VSCOcam with k1 preset"},"visibility":{"ispublic":1,"isfriend":0,"isfamily":0},"dates":{"posted":"1434394882","taken":"2015-06-13 12:51:14","takengranularity":"0","takenunknown":"0","lastupdate":"1434445581"},"views":"23","editability":{"cancomment":0,"canaddmeta":0},"publiceditability":{"cancomment":1,"canaddmeta":0},"usage":{"candownload":1,"canblog":0,"canprint":0,"canshare":1},"comments":{"_content":"0"},"notes":{"note":[]},"people":{"haspeople":0},"tags":{"tag":[]},"location":{"latitude":"52.418917","longitude":"10.785100","accuracy":"16","context":"0","neighbourhood":{"_content":"Stadtteil Wolfsburg","place_id":"WhlihUxTVLJhqUkmNQ","woeid":"26823353"},"locality":{"_content":"Wolfsburg","place_id":"E0zyhhBWUr1dyKs","woeid":"707678"},"county":{"_content":"Stadtkreis Wolfsburg","place_id":"3NbeUiNQUL9_BB.8dg","woeid":"12596975"},"region":{"_content":"Lower Saxony","place_id":"ul2d17NTUb4lkTA_","woeid":"2345486"},"country":{"_content":"Germany","place_id":"h7eZVDlTUb50Btij9Q","woeid":"23424829"},"place_id":"WhlihUxTVLJhqUkmNQ","woeid":"26823353"},"geoperms":{"ispublic":1,"iscontact":0,"isfriend":0,"isfamily":0},"urls":{"url":[{"type":"photopage","_content":"https:\/\/www.flickr.com\/photos\/marvinxsteadfast\/18841055371\/"}]},"media":"photo"},"stat":"ok"} -------------------------------------------------------------------------------- /autopages/README.md: -------------------------------------------------------------------------------- 1 | # Auto Pages 2 | 3 | This plugin adds an attribute `page` to the author, category, and tag 4 | objects which can be used in templates by themes. The page is processed as 5 | an ordinary Pelican page, so it can be Markdown, reStructuredText, etc. 6 | 7 | ## Configuration 8 | 9 | | Setting | Default | Notes | 10 | |----------------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| 11 | | `AUTHOR_PAGE_PATH` | `authors` | The location, relative to the project root where author pages can be found. The filename of the author page minus the extension must match the Author's slug. | 12 | | `CATEGORY_PAGE_PATH` | `categories` | The location, relative to the project root where category pages can be found. The filename of the category page minus the extension must match the Category's slug. | 13 | | `TAG_PAGE_PATH` | `tags` | The location, relative to the project root where tag pages can be found. The filename of the tag page minus the extension must match the Tag's slug. | 14 | 15 | ## Template Variables 16 | 17 | | Variable | Notes | 18 | |-----------------|--------------------------------------------| 19 | | `author.page` | The rendered content of the author page. | 20 | | `category.page` | The rendered content of the category page. | 21 | | `tag.page` | The rendered content of the tag page. | 22 | -------------------------------------------------------------------------------- /video_privacy_enhancer/video_service_thumbnail_url_generating_functions.py: -------------------------------------------------------------------------------- 1 | """A function for each service to download the video thumbnail 2 | 3 | Each function should accept one argument (the video id from that service) and should return the download URL for the video's thumbnail. 4 | 5 | """ 6 | 7 | """ 8 | LIBRARIES 9 | """ 10 | 11 | # from urllib.request import urlopen # For downloading the video thumbnails. Not as clean as, e.g., the requests module, but installed by default in many Python distributions. 12 | from six.moves.urllib.request import urlopen 13 | 14 | import json 15 | 16 | """ 17 | END OF LIBRARIES 18 | """ 19 | 20 | def generate_thumbnail_download_link_youtube(video_id_from_shortcode): 21 | """Thumbnail URL generator for YouTube videos.""" 22 | 23 | thumbnail_download_link="https://img.youtube.com/vi/" + video_id_from_shortcode + "/0.jpg" 24 | return thumbnail_download_link 25 | 26 | def generate_thumbnail_download_link_vimeo(video_id_from_shortcode): 27 | """Thumbnail URL generator for Vimeo videos.""" 28 | 29 | # Following the Vimeo API at https://developer.vimeo.com/api#video-request, we need to request the video's metadata and get the thumbnail from that. First, then, we'll get the metadata in JSON format, and then will parse it to find the thumbnail URL. 30 | video_metadata = urlopen("https://vimeo.com/api/v2/video/" + str(video_id_from_shortcode) + ".json").read() # Download the video's metadata in JSON format. 31 | video_metadata_parsed = json.loads(video_metadata.decode('utf-8')) # Parse the JSON 32 | video_thumbnail_large_location = video_metadata_parsed[0]['thumbnail_large'] # Go into the JSON and get the URL of the thumbnail. 33 | return video_thumbnail_large_location 34 | -------------------------------------------------------------------------------- /pdf/test_pdf.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import os 3 | import locale 4 | import logging 5 | import pdf 6 | 7 | from tempfile import mkdtemp 8 | from pelican import Pelican 9 | from pelican.readers import MarkdownReader 10 | from pelican.settings import read_settings 11 | from shutil import rmtree 12 | 13 | CUR_DIR = os.path.dirname(__file__) 14 | 15 | 16 | class TestPdfGeneration(unittest.TestCase): 17 | def setUp(self, override=None): 18 | self.temp_path = mkdtemp(prefix='pelicantests.') 19 | settings = { 20 | 'PATH': os.path.join(os.path.dirname(CUR_DIR), '..', 'test_data', 21 | 'content'), 22 | 'OUTPUT_PATH': self.temp_path, 23 | 'PLUGINS': [pdf], 24 | 'LOCALE': locale.normalize('en_US'), 25 | } 26 | if override: 27 | settings.update(override) 28 | 29 | self.settings = read_settings(override=settings) 30 | pelican = Pelican(settings=self.settings) 31 | 32 | try: 33 | pelican.run() 34 | except ValueError: 35 | logging.warn('Relative links in the form of ' + 36 | '|filename|images/test.png are not yet handled by ' + 37 | ' the pdf generator') 38 | pass 39 | 40 | def tearDown(self): 41 | rmtree(self.temp_path) 42 | 43 | def test_existence(self): 44 | assert os.path.exists(os.path.join(self.temp_path, 'pdf', 45 | 'this-is-a-super-article.pdf')) 46 | if MarkdownReader.enabled: 47 | assert os.path.exists(os.path.join(self.temp_path, 'pdf', 48 | 'a-markdown-powered-article.pdf')) 49 | -------------------------------------------------------------------------------- /pelican_comment_system/Readme.md: -------------------------------------------------------------------------------- 1 | # Pelican Comment System 2 | 3 | Pelican Comment System allows you to add static comments to your articles. 4 | 5 | Comments are stored in files in formats that can be processed by Pelican (e.g., Markdown, reStructuredText). Each comment resides in its own file. 6 | 7 | ### Features 8 | 9 | - Static comments for each article 10 | - Replies to comments 11 | - Avatars and [Identicons](https://en.wikipedia.org/wiki/Identicon) 12 | - Comment Atom feed for each article 13 | - Easy styleable via themes 14 | - Python 2 and 3 support 15 | 16 | 17 | See it in action here: [bernhard.scheirle.de](http://bernhard.scheirle.de/posts/2014/March/29/static-comments-via-email/) 18 | 19 | Author | Website | Github 20 | -------------------|-------------------------------|------------------------------ 21 | Bernhard Scheirle | | 22 | 23 | ## Instructions 24 | 25 | - [Quickstart Guide](doc/quickstart.md) 26 | - [Installation and basic usage](doc/installation.md) 27 | - [Import existing comments](doc/import.md) 28 | - [Avatars and identicons](doc/avatars.md) 29 | - [Comment Atom feed](doc/feed.md) 30 | 31 | ## Requirements 32 | 33 | Pelican 3.4 or newer is required. 34 | 35 | To create identicons, the Python Image Library is needed. Therefore you either need PIL **or** Pillow (recommended). 36 | 37 | **Install Pillow via:** 38 | 39 | pip install Pillow 40 | 41 | If you don't want avatars or identicons, this plugin works fine without PIL/Pillow. You will, however, see a warning that identicons are deactivated (as expected). 42 | 43 | ## Change Log 44 | 45 | The change log can be found in the [CHANGELOG.md](./CHANGELOG.md) file. 46 | -------------------------------------------------------------------------------- /representative_image/Readme.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | This plugin extracts a representative image (i.e, featured image) from the article's summary or content if not specifed in the metadata. 4 | 5 | The plugin also removes any images from the summary after extraction to avoid duplication. 6 | 7 | It allows the flexibility on where and how to display the featured image of an article together with its summary in a template page. For example, the article metadata can be displayed in thumbnail format, in which there is a short summary and an image. The layout of the summary and the image can be varied for aesthetical purpose. It doesn't have to depend on article's content format. 8 | 9 | Installation 10 | ------------ 11 | 12 | This plugin requires BeautifulSoup. 13 | 14 | pip install beautifulsoup4 15 | 16 | To enable, add the following to your settings.py: 17 | 18 | PLUGIN_PATH = 'path/to/pelican-plugins' 19 | PLUGINS = ["representative_image"] 20 | 21 | `PLUGIN_PATH` can be a path relative to your settings file or an absolute path. 22 | 23 | Usage 24 | ----- 25 | 26 | To override the default behaviour of selecting the first image in the article's summary or content, set the image property the article's metadata to the url of the image to display, e.g: 27 | 28 | ```markdown 29 | Title: My super title 30 | Date: 2010-12-03 10:20 31 | Category: Python 32 | Tags: pelican, publishing 33 | Slug: my-super-post 34 | Author: Alexis Metaireau 35 | Summary: Short version for index and feeds 36 | Image: /images/my-super-image.png 37 | 38 | Article content... 39 | ``` 40 | 41 | To include a representative image in a page add the following to the template: 42 | 43 | {% if article.featured_image %} 44 | 45 | {% endif %} 46 | -------------------------------------------------------------------------------- /pelican_comment_system/doc/quickstart.md: -------------------------------------------------------------------------------- 1 | # Quickstart Guide (with Comment form) 2 | 3 | This guide shows you how to setup the plugin for basic usage. 4 | The default theme has an comment form included. 5 | This form allows your visitors to easily write comments and send them to you via email [1]. 6 | 7 | 1. Merge the `./theme` folder with your own theme folder, or copy the files manually 8 | ``` 9 | mkdir -p [yourtheme]/templates/pcs 10 | mkdir -p [yourtheme]/static/js 11 | cp ./theme/templates/pcs/comments.html [yourtheme]/templates/pcs/comments.html 12 | cp ./theme/static/js/comments.js [yourtheme]/static/js/comments.html 13 | ``` 14 | 15 | 2. Modify your `article.html` template: 16 | 1. Add `{% import 'pcs/comments.html' as pcs with context %}` to the top 17 | 2. Add `{{ pcs.comments_quickstart("emailuser", "example.com") }}` where you want your comments (e.g. below `{{ article.content }}`) 18 | "emailuser@example.com" will be the e-mail address used for the `mailto:` link [1] 19 | 20 | 3. Enable the plugin: `pelicanconf.py` (See also [How to use plugins](https://github.com/getpelican/pelican-plugins/tree/master/#how-to-use-plugins)) 21 | ``` 22 | PELICAN_COMMENT_SYSTEM = True 23 | PELICAN_COMMENT_SYSTEM_IDENTICON_DATA = ('author',) 24 | ``` 25 | 26 | ## Notes 27 | * Instead of using `pcs.comments_quickstart` you can also use the other macros available in `comments.html`. 28 | They are a bit more flexible and may generate "better" html output e.g.: 29 | * Don't force load jQuery 30 | * No inline css 31 | 32 | [1] The comment form generates a `mailto:` link on submisson. The resulting email contains a valid Markdown block. Now you only have to copy this block to a new file, obviating the need to gather the metadata (such as date, author, replyto) yourself. -------------------------------------------------------------------------------- /liquid_tags/pelicanhtml_3.tpl: -------------------------------------------------------------------------------- 1 | {%- extends 'basic.tpl' -%} 2 | 3 | {% block stream_stdout -%} 4 |
5 |
 6 | {{- output.text | ansi2html -}}
 7 | 
8 |
9 | {%- endblock stream_stdout %} 10 | 11 | {% block stream_stderr -%} 12 |
13 |
14 | {{- output.text | ansi2html -}}
15 | 
16 |
17 | {%- endblock stream_stderr %} 18 | 19 | {% block error -%} 20 |
21 |
22 | {{- super() -}}
23 | 
24 |
25 | {%- endblock error %} 26 | 27 | {%- block data_text scoped %} 28 |
29 |
30 | {{- output.data['text/plain'] | ansi2html -}}
31 | 
32 |
33 | {%- endblock -%} 34 | 35 | {% block input %} 36 | {% if "# " in cell.source %} 37 |
Expand Code 38 | 41 |
42 | {% elif "# " in cell.source %} 43 |
Collapse Code 44 |
45 | {{ cell.source.replace("# \n", "") | highlight_code(metadata=cell.metadata) }} 46 |
47 |
48 | {% else %} 49 |
50 |
51 | {{ cell.source | highlight_code(metadata=cell.metadata) }} 52 |
53 |
54 | {% endif %} 55 | {%- endblock input %} 56 | -------------------------------------------------------------------------------- /liquid_tags/soundcloud.py: -------------------------------------------------------------------------------- 1 | """ 2 | Soundcloud Tag 3 | -------------- 4 | This implements a Liquid-style soundcloud tag for Pelican. 5 | 6 | It asks the official Soundcloud-API for the widget html code. 7 | 8 | Syntax 9 | ------ 10 | `{% soundcloud track_url %}` 11 | 12 | Example 13 | ------- 14 | `{% soundcloud https://soundcloud.com/luftmentsh/hakotel %}` 15 | 16 | Output 17 | ------ 18 | `` 19 | """ 20 | from .mdx_liquid_tags import LiquidTags 21 | import re 22 | import json 23 | try: 24 | from urllib.request import urlopen 25 | except ImportError: 26 | from urllib import urlopen 27 | 28 | 29 | SYNTAX = '{% soundcloud track_url %}' 30 | PARSE_SYNTAX = re.compile(r'(?Phttps?://soundcloud.com/[\S]+)') 31 | 32 | 33 | def get_widget(track_url): 34 | r = urlopen( 35 | 'http://soundcloud.com/oembed', 36 | data='format=json&url={}'.format(track_url).encode('utf-8')) 37 | 38 | return json.loads(r.read().decode('utf-8'))['html'] 39 | 40 | 41 | def match_it(markup): 42 | match = PARSE_SYNTAX.search(markup) 43 | if match: 44 | return match.groupdict() 45 | else: 46 | raise ValueError('Error processing input. ' 47 | 'Expected syntax: {}'.format(SYNTAX)) 48 | 49 | 50 | @LiquidTags.register('soundcloud') 51 | def soundcloud(preprocessor, tag, markup): 52 | track_url = match_it(markup)['track_url'] 53 | 54 | return get_widget(track_url) 55 | 56 | 57 | # --------------------------------------------------- 58 | # This import allows image tag to be a Pelican plugin 59 | from liquid_tags import register 60 | -------------------------------------------------------------------------------- /post_stats/readme.rst: -------------------------------------------------------------------------------- 1 | Post Statistics 2 | ================== 3 | 4 | A Pelican plugin to calculate various statistics about a post and store them in an article.stats dictionary: 5 | 6 | - ``wc``: how many words 7 | - ``read_mins``: how many minutes would it take to read this article, based on 250 wpm (http://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension) 8 | - ``word_counts``: frquency count of all the words in the article; can be used for tag/word clouds 9 | - ``fi``: Flesch-kincaid Index/ Reading Ease (see: http://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests) 10 | - ``fk``: Flesch-kincaid Grade Level 11 | 12 | Example: 13 | 14 | .. code-block:: python 15 | 16 | { 17 | 'wc': 2760, 18 | 'fi': '65.94', 19 | 'fk': '7.65', 20 | 'word_counts': Counter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, ...}), 21 | 'read_mins': 12 22 | } 23 | 24 | This allows you to output these values in your templates, like this, for example: 25 | 26 | .. code-block:: html+jinja 27 | 28 |

~{{ article.stats['read_mins'] }} min read

29 |
    30 |
  • Flesch-kincaid Index/ Reading Ease: {{ article.stats['fi'] }}
  • 31 |
  • Flesch-kincaid Grade Level: {{ article.stats['fk'] }}
  • 32 |
33 | 34 | The ``word_counts`` variable is a python ``Counter`` dictionary and looks something like this, with each unique word and it's frequency: 35 | 36 | .. code-block:: python 37 | 38 | Counter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, u'karma': 50, ..... 39 | 40 | and can be used to create a tag/word cloud for a post. 41 | 42 | Requirements 43 | ---------------- 44 | 45 | `post_stats` requires BeautifulSoup. 46 | 47 | .. code-block:: console 48 | 49 | $ pip install beautifulsoup4 50 | -------------------------------------------------------------------------------- /author_images/author_images.py: -------------------------------------------------------------------------------- 1 | """ 2 | Author images plugin for Pelican 3 | =========================== 4 | 5 | This plugin assigns the ``author.avatar`` and ``author.image`` variables to the 6 | avatar and image of the author in question. Authors are identified by email 7 | address, and avatars are images are stored in directories configured by 8 | AUTHOR_AVATARS and AUTHOR_IMAGES. 9 | """ 10 | 11 | from pelican import signals 12 | from hashlib import sha256 13 | from os.path import exists 14 | 15 | EXTENSIONS = ['jpg', 'png', 'svg'] 16 | 17 | 18 | def add_author_image(author, generator): 19 | hashsum = sha256(author.name).hexdigest() 20 | static = generator.settings['THEME'] + '/static/' 21 | if 'AUTHOR_AVATARS' in generator.settings.keys(): 22 | avatar = generator.settings['AUTHOR_AVATARS'] + '/' + hashsum 23 | for ext in EXTENSIONS: 24 | if exists('%s%s.%s' % (static, avatar, ext)): 25 | author.avatar = '%s/%s.%s' % \ 26 | (generator.settings['THEME_STATIC_DIR'], avatar, ext) 27 | break 28 | 29 | if 'AUTHOR_IMAGES' in generator.settings.keys(): 30 | image = generator.settings['AUTHOR_IMAGES'] + '/' + hashsum 31 | for ext in EXTENSIONS: 32 | if exists('%s%s.%s' % (static, image, ext)): 33 | author.image = '%s/%s.%s' % \ 34 | (generator.settings['THEME_STATIC_DIR'], image, ext) 35 | break 36 | 37 | 38 | def add_author_images(generator): 39 | for article in generator.articles: 40 | for author in article.authors: 41 | add_author_image(author, generator) 42 | for author, _ in generator.authors: 43 | add_author_image(author, generator) 44 | 45 | 46 | def register(): 47 | signals.article_generator_finalized.connect(add_author_images) 48 | -------------------------------------------------------------------------------- /bootstrap-rst/doc/components-labels.txt: -------------------------------------------------------------------------------- 1 | Labels 2 | =============================================================================== 3 | 4 | Examples 5 | -------- 6 | 7 | .. container:: bs-example 8 | 9 | :h1:`Example heading New` 10 | 11 | :h2:`Example heading New` 12 | 13 | :h3:`Example heading New` 14 | 15 | :h4:`Example heading New` 16 | 17 | :h5:`Example heading New` 18 | 19 | :h6:`Example heading New` 20 | 21 | 22 | .. code:: 23 | :class: highlight 24 | 25 | h1. Example heading :label-default:`New` 26 | ======================================== 27 | 28 | h2. Example heading :label-default:`New` 29 | ---------------------------------------- 30 | 31 | h3. Example heading :label-default:`New` 32 | ++++++++++++++++++++++++++++++++++++++++ 33 | 34 | h4. Example heading :label-default:`New` 35 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | 37 | h5. Example heading :label-default:`New` 38 | **************************************** 39 | 40 | h6. Example heading :label-default:`New` 41 | ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ 42 | 43 | 44 | Available variations 45 | -------------------- 46 | 47 | .. container:: bs-example 48 | 49 | :label-default:`Default` 50 | :label-primary:`Primary` 51 | :label-success:`Success` 52 | :label-info:`Info` 53 | :label-warning:`Warning` 54 | :label-danger:`Danger` 55 | 56 | .. code:: 57 | :class: highlight 58 | 59 | :label-default:`Default` 60 | :label-primary:`Primary` 61 | :label-success:`Success` 62 | :label-info:`Info` 63 | :label-warning:`Warning` 64 | :label-danger:`Danger` 65 | -------------------------------------------------------------------------------- /Contributing.rst: -------------------------------------------------------------------------------- 1 | Contributing a plugin 2 | ===================== 3 | 4 | Details regarding how to write a plugin are explained in the Pelican `docs`_. 5 | 6 | If you want to contribute, **please be sure** to read our general contributing 7 | `guidelines`_ first. Then you can fork this repository, create a new branch, 8 | make your changes, squash your commits, and issue your pull request from your 9 | new branch (i.e., **not** the ``master`` branch). 10 | 11 | Make sure that your plugin follows the structure below:: 12 | 13 | my_plugin 14 | ├── __init__.py 15 | ├── my_plugin.py 16 | ├── test_my_plugin.py 17 | └── ReadMe.rst / ReadMe.md 18 | 19 | ``my_plugin.py`` is the actual plugin implementation. Include a brief 20 | explanation of what the plugin does as a module docstring. Put any further 21 | explanations and usage details into the ``ReadMe`` file. 22 | 23 | ``__init__.py`` should contain a single line with ``from .my_plugin import *``. 24 | 25 | Place tests for your plugin in the same folder inside ``test_my_plugin.py``. 26 | If you need content or templates in your tests, you can use the main 27 | ``test_data`` folder for that purpose. 28 | 29 | **Note:** Each plugin can contain a LICENSE file stating the license it's 30 | released under. If there is an absence of LICENSE then it defaults to the 31 | *GNU AFFERO GENERAL PUBLIC LICENSE Version 3*. Please refer to the ``LICENSE`` 32 | file for the full text of the license. 33 | 34 | Before making your initial commit, please be sure to add an entry to the repo's 35 | top-level ``ReadMe`` file, adding your plugin to the list (in alphabetical 36 | order) and providing a brief description. 37 | 38 | .. _guidelines: http://docs.getpelican.com/en/latest/contribute.html#using-git-and-github 39 | .. _docs: http://docs.getpelican.com/en/latest/plugins.html#how-to-create-plugins 40 | -------------------------------------------------------------------------------- /bootstrap-rst/roles.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ----------------------------------------------------------------------------- 3 | # Bootstrap RST 4 | # Copyright (c) 2014, Nicolas P. Rougier 5 | # Distributed under the (new) BSD License. See LICENSE.txt for more info. 6 | # ----------------------------------------------------------------------------- 7 | from docutils import nodes, utils 8 | from docutils.parsers.rst import roles 9 | 10 | class h1(nodes.Inline, nodes.TextElement): pass 11 | class h2(nodes.Inline, nodes.TextElement): pass 12 | class h3(nodes.Inline, nodes.TextElement): pass 13 | class h4(nodes.Inline, nodes.TextElement): pass 14 | class h5(nodes.Inline, nodes.TextElement): pass 15 | class h6(nodes.Inline, nodes.TextElement): pass 16 | 17 | class label_default(nodes.Inline, nodes.TextElement): pass 18 | class label_muted(nodes.Inline, nodes.TextElement): pass 19 | class label_primary(nodes.Inline, nodes.TextElement): pass 20 | class label_success(nodes.Inline, nodes.TextElement): pass 21 | class label_info(nodes.Inline, nodes.TextElement): pass 22 | class label_warning(nodes.Inline, nodes.TextElement): pass 23 | class label_danger(nodes.Inline, nodes.TextElement): pass 24 | 25 | 26 | roles.register_generic_role('h1',h1) 27 | roles.register_generic_role('h2',h2) 28 | roles.register_generic_role('h3',h3) 29 | roles.register_generic_role('h4',h4) 30 | roles.register_generic_role('h5',h5) 31 | roles.register_generic_role('h6',h6) 32 | 33 | roles.register_generic_role('label-default',label_default) 34 | roles.register_generic_role('label-muted',label_muted) 35 | roles.register_generic_role('label-primary',label_primary) 36 | roles.register_generic_role('label-success',label_success) 37 | roles.register_generic_role('label-info',label_info) 38 | roles.register_generic_role('label-warning',label_warning) 39 | roles.register_generic_role('label-danger',label_danger) 40 | --------------------------------------------------------------------------------